Commit 243d8f98 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #48981 fix tests failures

parent 07a9ea20
......@@ -18,6 +18,7 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class AbonneController extends ZendAfi_Controller_Action {
protected $_user = null; // Le user connecté
......
......@@ -594,6 +594,7 @@ class AccueilControllerWithParentProfileConfigBoiteLoginPostTest
class AccueilControllerPostConfigBoiteKiosqueProfilLognesTest extends Admin_AbstractControllerTestCase {
public function setUp() {
parent::setUp();
......@@ -615,9 +616,10 @@ class AccueilControllerPostConfigBoiteKiosqueProfilLognesTest extends Admin_Abst
$this->preferences = Class_Profil::getCurrentProfil()->getModuleAccueilConfig(32, 'KIOSQUE')['preferences'];
}
/** @test **/
public function postConfigShouldRedirectToReferrer() {
$this->assertRedirectTo('/');
$this->assertXpathContentContains('//script', 'parent.window.location = parent.document.location.href;');
}
......
......@@ -907,9 +907,7 @@ class CatalogueControllerEditInPopupPostTest extends CatalogueControllerEditInPo
/** @test */
public function responseShouldBeARedirectWithJavascript() {
$this->_xpath->assertXPathContentContains($this->_json->content,
'//script',
'window.location="opac/index"');
$this->assertXpathContentContains('//script', 'parent.window.location = parent.document.location.href;');
}
}
......@@ -936,9 +934,7 @@ class CatalogueControllerAddCatalogueInPopupPostTest extends CatalogueController
/** @test */
public function responseShouldBeARedirectWithJavascript() {
$this->_xpath->assertXPathContentContains($this->_json->content,
'//script',
'window.location="opac/index"');
$this->assertXpathContentContains('//script', 'parent.window.location = parent.document.location.href;');
}
}
......
......@@ -1171,9 +1171,7 @@ class CmsControllerArticleConcertEditActionPostRenderPopupTest extends CmsContro
/** @test */
public function responseShouldBeARedirectWithJavascript() {
$this->_xpath->assertXPathContentContains($this->_json->content,
'//script',
'window.location="opac/index"');
$this->assertXpathContentContains('//script', 'parent.window.location = parent.document.location.href;');
}
......
......@@ -864,8 +864,10 @@ class AbonneControllerAvisBlogControllerViewReadAvisTest extends AbonneFlorence
class AbonneControllerEditAvisNoticeNotFoundActionTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->dispatch('/opac/abonne/editavisnotice/id/54', true);
......@@ -874,11 +876,14 @@ class AbonneControllerEditAvisNoticeNotFoundActionTest extends AbstractControlle
/** @test */
public function responseShouldReloadPage() {
$this->assertTrue(false !== strpos(json_decode($this->_response->getBody())->title, 'Sauvegarde en cours'));
$this->assertXPathContentContains('//script', 'parent.window.location = parent.document.location.href;', $this->_response->getBody());
}
}
class AbonneControllerEditAvisNoticeNotAdminLoggedActionTest extends AbstractControllerTestCase {
protected function _loginHook($account) {
$account->ROLE_LEVEL = ZendAfi_Acl_AdminControllerRoles::INVITE;
......@@ -896,8 +901,7 @@ class AbonneControllerEditAvisNoticeNotAdminLoggedActionTest extends AbstractCon
/** @test */
public function responseShouldReloadPage() {
$this->assertTrue(false !== strpos(json_decode($this->_response->getBody())->title, 'Sauvegarde en cours'),
$this->_response->getBody());
$this->assertXpathContentContains('//script', 'parent.window.location = parent.document.location.href;');
}
}
......@@ -1024,7 +1028,7 @@ class AbonneControllerDeleteAvisNoticeAdminLoggedActionTest extends AbstractCont
/** @test */
public function shouldContainsSciptToRedirectToReferer() {
$this->assertContains('window.location=\"opac\/recherche\/viewnotice\/id\/1\"', $this->_response->getBody());
$this->assertXpathContentContains('//script', 'parent.window.location = parent.document.location.href;');
}
}
......
Markdown is supported
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