1

尝试使用包含的空格字符测试 uri 失败。uri 是/contact/latestReport/Most recent. 以下每个试验的结果

当前节点列表为空

试验包括:

  • $crawler = $client->request('GET', '/contact/latestReport/Most recent');

  • $crawler = $client->request('GET', '/contact/latestReport/Most%20recent');

  • $uri = urlencode('/contact/latestReport/Most recent'); $crawler = $client->request('GET', urldecode($uri));

编辑:这是实际的测试代码。它以前的工作版本仅包含/contact/latestReport. 添加/Most recent仅在测试中产生错误。[客户要求一份非常相似的报告,因此有现在/Most recent/FY to date版本。] 在开发和生产环境中/contact/latestReport/Most recent产生了预期的结果。

public function testLatestContacts()
{
    $crawler = $this->login();
    $crawler = $this->client->request('GET', '/contact/latestReport/Most recent');
    $truckee = $this->fixtures->getReference('truckee')->getId();
    $form = $crawler->selectButton('Submit')->form();
    $form['select_center[center]'] = $truckee;
    $crawler = $this->client->submit($form);

    $this->assertGreaterThan(0, $crawler->filter('html:contains("No contacts found")')->count());
}
4

1 回答 1

0

哎呀!通过不清除测试缓存再次位。清除缓存后测试有效。

于 2016-08-20T21:53:59.903 回答