0
如果我有一個功能測試,如:Symfony的測試獲取表單錯誤
public function testCreate()
{
$client = $this->makeClient();
$crawler = $client->request('POST', "/post/new");
$form = $crawler->selectButton("Create Post")->form();
$values = $form->getPhpValues();
$values['post']['title'] = 'test';
$values['post']['content'] = null; // Should fail because it isn't a string.
$crawler = $client->request($form->getMethod(), $form->getUri(), $values,
$form->getPhpFiles());
assertEquals() // What goes here?
}
如何使用crawler
拿到表格錯誤並加以比較?
感謝您的 - 我會用1去,我想我將不得不使用'filter'而且也沒有捷徑? – Darkstarone
是的,只要使用'filter()'就像你做的那樣。 – xabbuh