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으로
어디에서 자동로드를 정의합니까? 어디에서로드하고 있습니까? – fiunchinho
appkernel ...을 사용하는 단위 테스트 ...? –
공급 업체를 설치하는 것을 잊어 버리셨습니까? –