2016-08-20 32 views
1

嘗試使用包含的空格字符測試uri失敗。該uri是/contact/latestReport/Most recent。每個下面的結果試驗中測試包含空格字符的uri「當前節點列表爲空」

當前節點列表是空的

試驗包括:

  • $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版本。]在dev &產品環境/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()); 
} 
+0

你需要顯示你的代碼。使用'%20'應該可以。 – Barmar

回答

0

哎呀!再次通過不清除測試緩存。測試在清除緩存時有效。

相關問題