2013-04-03 2 views
0

symfony2를 사용하고 있습니다. 다음과 같은 내 AppKernel의 코드는 같습니다 symfony2의 치명적인 오류 AppKernel 찾는 커널 클래스

namespace My\BookBundle\Tests\Controller; 

use My\BookBundle\Services\TestHelper; 
use My\BookBundle\Tests\BaseTest; 

class WriterControllerTest extends BaseTest 
{ 
    /** 
    * @var TestHelper 
    */ 
    protected $testHelper; 

    public function __construct() 
    { 
     parent::__construct(); 
     $this->testHelper = $this->get('test_helper'); 
    } 

    public function setUp() 
    { 
     $this->testHelper->setupTestData(); 
    } 

이 이전에 꽤 원활 응용 프로그램과 테스트를 실행했다 : 같은
use Symfony\Component\HttpKernel\Kernel; 
use Symfony\Component\Config\Loader\LoaderInterface; 

class AppKernel extends Kernel 
{ 
    public function registerBundles() 
    { 
     $bundles = array(
      new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), 
      new Symfony\Bundle\SecurityBundle\SecurityBundle(), 
      new Symfony\Bundle\TwigBundle\TwigBundle(), 
      new Symfony\Bundle\MonologBundle\MonologBundle(), 
      new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), 
      new Symfony\Bundle\AsseticBundle\AsseticBundle(), 
      new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), 
      new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), 
      new JMS\AopBundle\JMSAopBundle(), 
      new JMS\DiExtraBundle\JMSDiExtraBundle($this), 
      new JMS\SecurityExtraBundle\JMSSecurityExtraBundle() 
     ); 

     if (in_array($this->getEnvironment(), array('dev', 'test'))) { 
      $bundles[] = new My\BookBundle\MyBookBundle(); 
      $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 
      $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 
      $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 
     } 

     return $bundles; 
    } 

지금 Bookbundle에서 단위 테스트 중 하나에 대한 내 코드 보인다. 그런 다음 컨트롤러, 저장소 기능 등과 같은 많은 기능 코드를 추가하고있었습니다. 당신이 언급 한 위에서 볼 수

PHP Fatal error: Class 'Symfony\Component\HttpKernel\Kernel' not found in /var/www/Symfony/app/AppKernel.php on line 7 

라인 7 AppKernel 클래스의 선언을 참조 : 지금은 내가 명령 프롬프트에서 다음과 같은 오류가 오전 테스트를 작성하여 백업 코드를 시도 할 때 암호.

혼란스럽고 갑자기 코드가 깨지는 이유를 찾을 수 없습니다.

도와 주시겠습니까? @ONe으로

+2

어디에서 자동로드를 정의합니까? 어디에서로드하고 있습니까? – fiunchinho

+2

appkernel ...을 사용하는 단위 테스트 ...? –

+1

공급 업체를 설치하는 것을 잊어 버리셨습니까? –

답변

0

: 단위 테스트가 appkernel를 사용하지 않는 - 그것은 단지 @Ramon Kleiss에

을 보여주는 오류입니다 : : 내 자동로드가

@Wouter J으로

응용 프로그램 폴더에 정의 I 공급 업체를 설치 및 제거한 다음 다시 설치하십시오. 아무것도 바뀌지 않았다.

이유가 무엇인지 알 수는 없지만 문제를 해결할 수있었습니다. 그것은 Test and Vendor 폴더의 허가 변경과 관련이 있습니다. 이전에 실행 중이라고 언급했듯이 - 내 번들 테스트 폴더 및 벤더 폴더에 대한 일부 알 수없는 이유로 권한이 변경되어 적절한 파일에 액세스 할 수 없었습니다. 설치를 제거하고 저장소에서 신선한 복제본을 가져 와서 규칙에 따라 프로젝트를 설치했는데 모든 것이 잘되었습니다. 필자는 이전 프로젝트 파일 시스템과 최신 프로젝트 파일 시스템의 차이점을 파악한 결과 권한 만 차이가 있음을 발견했습니다.

답변 해 주셔서 감사합니다.

관련 문제