Skip to content
Snippets Groups Projects
Commit 9e9d30f0 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline_#18075_fix__private_profil_and_rewrite_url fix test failures

parent eda24515
Branches
Tags
5 merge requests!715Master,!688Master,!687Hotline master,!683backport fix to master,!671Hotline #18075 fix private profil and rewrite url
......@@ -109,6 +109,7 @@ class ZendAfi_Controller_Plugin_DefineURLs extends Zend_Controller_Plugin_Abstra
$redirect = '?redirect=' . urlencode('/index/index/id_profil/' . $profil->getId());
return $this->getResponse()->setRedirect(BASE_URL . '/auth/login/id_profil/1' . $redirect);
}
$request->setControllerName('auth');
$request->setActionName('login');
}
......
......@@ -259,13 +259,17 @@ class IndexControllerRewriteUrlTest extends AbstractControllerTestCase {
/** @test */
public function privateProfilShouldRedirectToLogin() {
$this->dispatch('/zork', true);
$this->assertContains('/auth/login/id_profil/1?redirect=%2Findex%2Findex%2Fid_profil%2F345', $this->_response->getHeaders()[0]['value']);
$this->assertModule('opac');
$this->assertController('auth');
$this->assertAction('login');
}
/** @test */
public function publicProfilWithPrivateParentProfilShouldRedirectToLogin() {
$this->dispatch('/zork-child', true);
$this->assertContains('/auth/login/id_profil/1?redirect=%2Findex%2Findex%2Fid_profil%2F879', $this->_response->getHeaders()[0]['value']);
$this->assertModule('opac');
$this->assertController('auth');
$this->assertAction('login');
}
}
\ No newline at end of file
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