Skip to content
Snippets Groups Projects
Commit 46681e5f authored by llaffont's avatar llaffont
Browse files

Correction tests menus

parent 2a3ac03c
Branches
Tags
No related merge requests found
......@@ -22,8 +22,9 @@
abstract class ZendAfi_View_Helper_Menu_Base extends ZendAfi_View_Helper_BaseHelper {
public static function getModuleHelperFromParams($id_menu, $menu) {
if (!array_isset('preferences', $menu))
$menu['preferences'] = array();
$menu['preferences']['picto'] = $menu['picto'];
$menu['preferences'] = [];
$menu['preferences']['picto'] = $menu['picto'] ;
$menu['preferences']['libelle'] = $menu['libelle'];
return Class_Systeme_ModulesMenu::isModuleAccueil($menu)
......
......@@ -40,6 +40,7 @@ class IndexControllerAsInviteTest extends AbstractControllerTestCase {
/** @test */
public function linkToConfigurePageShouldNotBeInFooter() {
Class_Profil::newInstanceWithId(1, ['cfg_menus' => '']);
$this->dispatch('/?id_profil=1');
$this->assertNotXPath('//a[contains(@href, "admin/profil/accueil/id_profil/1")]');
}
......
......@@ -340,12 +340,21 @@ class ProfilOptionsControllerViewProfilAdulteTest extends ProfilOptionsControlle
class ProfilOptionsControllerViewProfilAdulteAsAdminTest extends ProfilOptionsControllerWithProfilAdulteTestCase {
abstract class ProfilOptionsControllerProfilAdulteAsAdminTestCase extends ProfilOptionsControllerWithProfilAdulteTestCase {
public function setUp() {
parent::setUp();
$admin = Class_Users::newInstanceWithId(34, ['login' => 'admin'])->beAdminPortail();
ZendAfi_Auth::getInstance()->logUser($admin);
}
}
class ProfilOptionsControllerViewProfilAdulteAsAdminTest extends ProfilOptionsControllerProfilAdulteAsAdminTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/');
}
......@@ -365,6 +374,31 @@ class ProfilOptionsControllerViewProfilAdulteAsAdminTest extends ProfilOptionsCo
class ProfilOptionsControllerProfilAdulteAsAdminPostConfigCalendrierTest extends ProfilOptionsControllerProfilAdulteAsAdminTestCase {
public function setUp() {
parent::setUp();
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Profil')
->whenCalled('save')
->answers(true);
$this->postDispatch('/admin/menus/calendrier?config=menu&id_profil=2&id_module=8&type_menu=MODULE_ACCUEIL_CALENDAR&preferences=nb_events%3D5',
['nb_events' => 12,
'libelle' => 'Agenda']);
}
/** @test */
public function savedMenuCalendrierShouldHaveNbEvents12() {
$preferences = $this->profil_adulte->getMenuHorizontal()->getMenuPrefencesByIdModule(8);
$this->assertEquals(12, $preferences['nb_events']);
}
}
abstract class ProfilOptionsControllerProfilJeunesseWithPagesJeuxMusiqueTestCase extends AbstractControllerTestCase {
protected function _loginHook($account) {
$account->ROLE = "";
......
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