Skip to content
Snippets Groups Projects
Commit 1c38b57b authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #53821 make it working with telephone module

parent adf8f67a
Branches
Tags
3 merge requests!2080Sandbox detach zf from storm,!2061Master,!2010hotline #53821 when search done via a POST request, redirects to well formed url…
Pipeline #392 passed with stage
in 9 minutes and 26 seconds
......@@ -86,9 +86,13 @@ class RechercheController extends ZendAfi_Controller_Action {
if ($this->view->statut == 'guidee')
$criteres_recherche->updateRubrique('guidee');
if ($this->_request->isPost())
return $this->_redirect($this->view->url($criteres_recherche->getUrlCriteresWithFacettes(), null, true),
if ($this->_request->isPost()) {
$params = $criteres_recherche->getUrlCriteresWithFacettes();
// preserve module as we may come from Telephone_RechercheController
$params['module'] = $this->_request->getModuleName();
return $this->_redirect($this->view->url($params, null, true),
['prependBase' => false]);
}
$this->getFrontController()->getRouter()->getCurrentRoute()
->match(str_replace(BASE_URL,
......
......@@ -58,23 +58,26 @@ class Telephone_RechercheControllerSimpleSeveralInexistingWordsActionTest extend
class Telephone_RechercheControllerSimpleOneInexistingWordActionTest extends TelephoneAbstractControllerTestCase {
public function setUp() {
parent::setUp();
$this->postDispatch('/telephone/recherche/simple',
array('expressionRecherche' => 'zzriuezz'));
}
/** @test */
public function pageShouldNotContainsLinkToElargirLaRecherche() {
$this->dispatch('/telephone/recherche/simple/expressionRecherche/zzriuezz', true);
$this->assertNotXPath('//a[contains(@href, "recherche/simple/pertinence/1")]');
}
/** @test */
public function pageShouldDisplayAucunResultat() {
$this->dispatch('/telephone/recherche/simple/expressionRecherche/zzriuezz', true);
$this->assertXPathContentContains('//div', 'Aucun résultat trouvé');
}
/** @test */
public function postShouldRedirect() {
$this->postDispatch('/telephone/recherche/simple/',
['expressionRecherche' => 'zzriuezz']);
$this->assertRedirectTo('/telephone/recherche/simple/expressionRecherche/zzriuezz');
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment