나는 doctrine을 실행하는 컨트롤러에서 기능 테스트를 시도합니다. 테스트를 실행할 때 실패합니다. 하지만 내 컨트롤러에서이 줄에 주석을 달았을 때 : "$ products = $ em-> getRepository ("Couture \ FrontBundle \ Entity \ Produit ") -> findAll()". 시험은 성공적입니다.PB 기능 테스트 symfony2 컨트롤러
class ProductControllerTest extends WebTestCase {
public function testGetAll() {
$client = static::createClient();
$client->request('GET', $client->getContainer()->get('router')->generate('couture_front_product_getall'));
$this->assertEquals(
200, $client->getResponse()->getStatusCode()
);
}
}