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

CIP #57952 fix tests failrues

parent 927f2ff8
Branches
Tags
2 merge requests!2334Master,!2079Dev#57952 cip priorisation des ecrans de config
Pipeline #1094 passed with stage
in 11 minutes and 52 seconds
...@@ -304,7 +304,7 @@ class Admin_ModulesController extends ZendAfi_Controller_Action { ...@@ -304,7 +304,7 @@ class Admin_ModulesController extends ZendAfi_Controller_Action {
public function recordAction() { public function recordAction() {
$codif = Class_Codification::getInstance(); $codif = Class_Codification::getInstance();
$this->view->titre = $this->_('Configuration de l\'affichage du type %s', $this->view->titre = $this->_('Configuration de l\'affichage du type %s',
$codif->getLibelleFacette('T' . $this->_getParam('action2'))); $codif->getLibelleFacette(Class_CodifTypeDoc::CODE_FACETTE . $this->_getParam('action2')));
if ($this->isValidPostNotice()) if ($this->isValidPostNotice())
return $this->updateEtRetour($this->getPostNotice()); return $this->updateEtRetour($this->getPostNotice());
......
...@@ -22,9 +22,12 @@ ...@@ -22,9 +22,12 @@
class Class_Systeme_Widget_Menu extends Class_Systeme_Widget_Abstract { class Class_Systeme_Widget_Menu extends Class_Systeme_Widget_Abstract {
public static function findAllAsArray() { public static function findAllAsArray($id_profil) {
if(!$profil = Class_Profil::find($id_profil))
return [];
$all = []; $all = [];
$profil = Class_Profil::getCurrentProfil();
$datas = $profil->getCfgMenusAsArray(); $datas = $profil->getCfgMenusAsArray();
foreach($datas as $key => $params) foreach($datas as $key => $params)
$all[$key] = (new static()) $all[$key] = (new static())
......
...@@ -64,13 +64,13 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue ...@@ -64,13 +64,13 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
$menu_deplie ? "" : "display:none"); $menu_deplie ? "" : "display:none");
$id_profil = $profil->getId(); $id_profil = $profil->getId();
$menus = Class_Systeme_Widget_Menu::findAllAsArray(); $menus = Class_Systeme_Widget_Menu::findAllAsArray($id_profil);
if (!isset($menus[$menu])) if (!isset($menus[$menu]))
$menus = Class_Profil::getPortail()->getCfgMenusAsArray(); $menus = Class_Profil::getPortail()->getCfgMenusAsArray();
if (!isset($menus[$menu])) if (!isset($menus[$menu]))
return $this->retourErreur($this->translate()->_('Ce menu ne contient aucune entrée.')); return $this->retourErreur($this->_('Ce menu ne contient aucune entrée.'));
$config = $menus[$menu]; $config = $menus[$menu];
......
...@@ -26,7 +26,7 @@ class ZendAfi_View_Helper_Admin_Menus extends Zendafi_View_Helper_Basehelper { ...@@ -26,7 +26,7 @@ class ZendAfi_View_Helper_Admin_Menus extends Zendafi_View_Helper_Basehelper {
public function menus() { public function menus() {
$this->_profil = Class_Profil::getCurrentProfil(); $this->_profil = Class_Profil::getCurrentProfil();
$datas = Class_Systeme_Widget_Menu::findAllAsArray(); $datas = Class_Systeme_Widget_Menu::findAllAsArray($this->_profil->getId());
$html = [$this->_renderNav($datas['H'])]; $html = [$this->_renderNav($datas['H'])];
unset($datas['H']); unset($datas['H']);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* *
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software * along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
require_once 'library/ZendAfi/View/Helper/ViewHelperTestCase.php'; require_once 'library/ZendAfi/View/Helper/ViewHelperTestCase.php';
...@@ -273,7 +273,7 @@ class MenuVerticalSitothequeWithManyItemsTest extends MenuVerticalWithManyItemsT ...@@ -273,7 +273,7 @@ class MenuVerticalSitothequeWithManyItemsTest extends MenuVerticalWithManyItemsT
'titre' => 'Hurd', 'titre' => 'Hurd',
'description' => 'Pour tous les Gnus', 'description' => 'Pour tous les Gnus',
'url' => 'http://hurd.gnu.org']); 'url' => 'http://hurd.gnu.org']);
$this->_parentLabel = 'Nos Sites'; $this->_parentLabel = 'Nos Sites';
$this->_firstItemLabel = 'LinuxFr'; $this->_firstItemLabel = 'LinuxFr';
$this->_secondItemLabel = 'Hurd'; $this->_secondItemLabel = 'Hurd';
...@@ -445,16 +445,16 @@ class MenuVerticalWithMenuTest extends MenuVerticalTestCase { ...@@ -445,16 +445,16 @@ class MenuVerticalWithMenuTest extends MenuVerticalTestCase {
/** @test */ /** @test */
public function menuForProfilAdulteShouldHaveUrlIdProfilFourSelected() { public function menuForProfilAdulteShouldHaveUrlIdProfilFourSelected() {
$this->assertXPathContentContains($this->_html, $this->assertXPathContentContains($this->_html,
'//ul/li[contains(@class, "selected_profil")]/a[contains(@href, "/id_profil/4")]', '//ul/li[contains(@class, "selected_profil")]/a[contains(@href, "/id_profil/4")]',
'Profil adulte'); 'Profil adulte');
} }
/** @test */ /** @test */
public function menuForProfilJeunesseShouldHaveUrlIdProfilHeightNotSelected() { public function menuForProfilJeunesseShouldHaveUrlIdProfilHeightNotSelected() {
$this->assertXPathContentContains($this->_html, $this->assertXPathContentContains($this->_html,
'//ul/li[not(contains(@class, "selected_profil"))]/a[contains(@href, "/id_profil/8")]', '//ul/li[not(contains(@class, "selected_profil"))]/a[contains(@href, "/id_profil/8")]',
'Profil jeunesse'); 'Profil jeunesse');
} }
} }
...@@ -493,21 +493,16 @@ class MenuVerticalWithMenuFromOtherProfilTest extends ViewHelperTestCase { ...@@ -493,21 +493,16 @@ class MenuVerticalWithMenuFromOtherProfilTest extends ViewHelperTestCase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Zend_Controller_Front::getInstance()->setRequest(new Zend_Controller_Request_Http());
$this->fixture('Class_Profil', $this->fixture('Class_Profil',
['id' => 28, ['id' => 28,
'cfg_menus' => [ 'cfg_menus' => ['9' => ['libelle' => 'Menu vertical',
'9' => ['libelle' => 'Menu vertical', 'menus' => [['type_menu' => 'RSS',
'menus' => [ 'libelle' => 'Flux',
['type_menu' => 'RSS', 'picto' => 'vide.gif',
'libelle' => 'Flux', 'preferences' => ['id_items' => 2,
'picto' => 'vide.gif', 'id_categorie' => '',
'preferences' => ['id_items' => 2, 'nb' => 5]]]]]]);
'id_categorie' => '',
'nb' => 5]]]
]
]]);
$this->helper = new ZendAfi_View_Helper_Accueil_MenuVertical(12, [ $this->helper = new ZendAfi_View_Helper_Accueil_MenuVertical(12, [
...@@ -649,8 +644,8 @@ class MenuVerticalWithMenuAsLinkToProfilTest extends MenuVerticalTestCase { ...@@ -649,8 +644,8 @@ class MenuVerticalWithMenuAsLinkToProfilTest extends MenuVerticalTestCase {
/** @test */ /** @test */
public function menuForProfilAdulteShouldHaveUrlIdProfilHeightSelected() { public function menuForProfilAdulteShouldHaveUrlIdProfilHeightSelected() {
$this->assertXPathContentContains($this->_html, $this->assertXPathContentContains($this->_html,
'//ul/li[contains(@class, "selected_profil")]/a[contains(@href, "/id_profil/4")]', '//ul/li[contains(@class, "selected_profil")]/a[contains(@href, "/id_profil/4")]',
'Menu'); 'Menu');
} }
......
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