From 15fcaee3d3b76aed08cb737beef17da337413f2f Mon Sep 17 00:00:00 2001 From: gloas <gloas@afi-sa.fr> Date: Fri, 22 Sep 2017 15:28:02 +0200 Subject: [PATCH] hotline #64837 fix tests failures --- library/ZendAfi/View/Helper/FonctionsAdmin.php | 14 ++++++-------- .../ZendAfi/View/Helper/Accueil/KiosqueTest.php | 7 +++++++ .../View/Helper/Admin/FonctionsAdminTest.php | 3 ++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/library/ZendAfi/View/Helper/FonctionsAdmin.php b/library/ZendAfi/View/Helper/FonctionsAdmin.php index 8f99876bee0..1cc51cdb9f7 100644 --- a/library/ZendAfi/View/Helper/FonctionsAdmin.php +++ b/library/ZendAfi/View/Helper/FonctionsAdmin.php @@ -37,14 +37,12 @@ class ZendAfi_View_Helper_FonctionsAdmin extends ZendAfi_View_Helper_BaseHelper $actions = [$this->_extended($extended_actions)]; - if (!Class_Users::isCurrentUserAllowedToEditProfile($profile)) - return ''; - - $actions = array_merge($actions, - [$this->_config(), - $this->_versions(), - $this->_add(), - $this->_delete()]); + if (Class_Users::isCurrentUserAllowedToEditProfile($profile)) + $actions = array_merge($actions, + [$this->_config(), + $this->_versions(), + $this->_add(), + $this->_delete()]); $html = trim(implode(' ', array_filter($actions))); diff --git a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php index e1ef547edbc..05f9dbef3a4 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php @@ -188,6 +188,13 @@ class ZendAfi_View_Helper_Accueil_KiosqueCubeAsRedacteurWithCatalogueTest extend '//a[contains(@href, "admin/catalogue/add/id_catalogue/89/id_module/3")]', $this->_html); } + + + /** @test */ + public function linkToEditWidgetShouldNotBePresent() { + $this->assertNotXPath($this->_html, + '//a[contains(@href, "/admin/widget")]'); + } } diff --git a/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php b/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php index 2696defa8be..57040b6dc8e 100644 --- a/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php +++ b/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php @@ -58,7 +58,8 @@ class FonctionsAdminHelperTest extends ViewHelperTestCase { 'password' => 'password', 'id_site' => 1, 'role_level' => ZendAfi_Acl_AdminControllerRoles::ADMIN_BIB])); - $this->_content = $this->helper->fonctionsAdmin(0, false, null, [function() {return 'test';}]); + + $this->_content = $this->helper->fonctionsAdmin(); $this->assertEquals('', $this->_content); } } \ No newline at end of file -- GitLab