"InvalidArgumentException:現在のノードリストが空です。" PHPUnitによる機能テストの実行symfony2機能テストInvalidArgumentException:現在のノードリストが空です。
public function testAdd()
{
$client = static::createClientWithAuthentication('main');
$crawler = $client->request('GET', 'en/manage');
$send_button = $crawler->selectButton('submit');
$form = $send_button->form(array(
'PrCompany[email]' => '[email protected]',
'PrCompany[first_name]' => 'Anton',
'PrCompany[last_name]' => 'Tverdiuh',
'PrCompany[timezone]' => 'Europe/Amsterdam'
));
$form['PrCompany[companies][1]']->tick();
$client->submit($form);
$this->assertTrue($crawler->filter('html:contains("User is invited")')->count() > 0);
}
あなたの問題をもっと理解するのに役立つ同様の質問があります。回答はまだありません... http://stackoverflow.com/questions/9662697/symfony2-functional-testing-crawler-not-working – Matt
あなたは答えとして質問をしていませんので、私は自分自身を追加して、うまくいけば解決します質問 –
私は '$ form ['PrCompany [companies]'] [1] - > tick();を使う必要があると思います。 '(引用符の外に[1]がある) – caponica