私は以下のコードを持っています。私はコントローラをテストする必要があり、パラメータとしてリクエストを受け取ります。しかしカーネルブートエラー - symfony netbeans
Warning: Deprecated JSON test listener used
と
PayrollperiodControllerTest::testPayrollWeekCreateAction Error: Call to undefined method PayrollperiodControllerTest::bootKernel()
class PayrollperiodControllerTest extends PHPUnit_Framework_TestCase {
/**
* @var \Doctrine\ORM\EntityManager
*/
private $em;
/**
* {@inheritDoc}
*/
public function setUp()
{
self::bootKernel();
$this->em = static::$kernel->getContainer()
->get('doctrine')
->getManager();
}
public function testPayrollWeekCreateAction(Request $request) {
$request = Request::create('http://localhost:8000/web/app_dev.php/payrollperiod/new', 'GET');
$result=$this->em->handle($request);
$this->assertTrue($result->isSuccessful);
}
/**
* {@inheritDoc}
*/
public function tearDown() {
parent::tearDown();
$this->em->close();
$this->em = null; //avoid memory Leaks
}
}
どのように私はこれらのエラーを修正することができますを取得しておきますか?
要求を扱うことができないのEntityManager(
希望:これに代えて
をメソッドハンドルはありません)おそらくタイプミスですか? – Matteo
@Matteoメソッドハンドルは何ですか?私はコントローラーのマネージャーを使っていましたが、私はこれを初めて知っています。 – Zed