Skip to content
Snippets Groups Projects
Commit 1b86cdc7 authored by llaffont's avatar llaffont
Browse files

Add tests for menu fix of commit 7287b2d1

parent efe0d833
Branches
Tags
No related merge requests found
......@@ -48,7 +48,7 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
: [Class_Profil::getCurrentProfil()->getId(), $menu];
if (!$profil = Class_profil::find($id_profil))
$profil = Class_Profil::getCurrentProfil();
return $this->retourErreur($this->translate()->_('Ce menu ne contient aucune entrée.'));
$this->_cls_menu = new Class_Systeme_ModulesMenu();
$this->_li_style = sprintf('style="margin-left:20px;%s"',
......
......@@ -477,17 +477,19 @@ class MenuVerticalWithMenuFromOtherProfilTest extends ViewHelperTestCase {
parent::setUp();
Class_Profil::newInstanceWithId(28, ['cfg_menus' => [
'9' => ['libelle' => 'Menu vertical',
'menus' => [
['type_menu' => 'RSS',
'libelle' => 'Flux',
'picto' => 'vide.gif',
'preferences' => ['id_items' => 2,
'id_categorie' => '',
'nb' => 5]]]
]
]]);
$this->fixture('Class_Profil',
['id' => 28,
'cfg_menus' => [
'9' => ['libelle' => 'Menu vertical',
'menus' => [
['type_menu' => 'RSS',
'libelle' => 'Flux',
'picto' => 'vide.gif',
'preferences' => ['id_items' => 2,
'id_categorie' => '',
'nb' => 5]]]
]
]]);
$this->helper = new ZendAfi_View_Helper_Accueil_MenuVertical(12, [
......@@ -505,6 +507,14 @@ class MenuVerticalWithMenuFromOtherProfilTest extends ViewHelperTestCase {
public function menuShouldContainsLinkToRss() {
$this->assertXPathContentContains($this->_html, '//ul/li/a', 'Flux');
}
/** @test */
public function whenProfilIsDeletedMenuShouldBeDislayErrorMessage() {
Class_Profil::deleteBy(['id_profil' => 28]);
$this->assertContains('Ce menu ne contient aucune entrée',
$this->helper->getBoite());
}
}
......
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