diff --git a/library/Class/Systeme/ModulesMenu/Url.php b/library/Class/Systeme/ModulesMenu/Url.php index f7d01a61b3eb0225bf95fe58cf80155b4960b096..789f8b79ced3e71dac4311b414edf5e9078fe0b4 100644 --- a/library/Class/Systeme/ModulesMenu/Url.php +++ b/library/Class/Systeme/ModulesMenu/Url.php @@ -28,7 +28,7 @@ class Class_Systeme_ModulesMenu_Url extends Class_Systeme_ModulesMenu_Null { $_popupHeight = 290, $_isPhone = false, $_action = 'liensite', - $_defaultValues = ['target' => 1, + $_defaultValues = ['target' => 0, 'url' => '']; diff --git a/library/ZendAfi/Form/Configuration/Menu/LatestNews.php b/library/ZendAfi/Form/Configuration/Menu/LatestNews.php index d7fdee47d9745b93ff6013447fd31933ef8f2336..60308e39c86dd21c591998245968831eb9a005bd 100644 --- a/library/ZendAfi/Form/Configuration/Menu/LatestNews.php +++ b/library/ZendAfi/Form/Configuration/Menu/LatestNews.php @@ -21,7 +21,7 @@ class ZendAfi_Form_Configuration_Menu_LatestNews extends ZendAfi_Form_Configuration_Menu_Entry { - public function init($datas) { + public function init() { parent::init(); $this ->addElement('text', diff --git a/library/ZendAfi/View/Helper/Menu/Entry.php b/library/ZendAfi/View/Helper/Menu/Entry.php index e5baf648ca98ab9f4cd00af33c10af7f6842be5f..644f9c89994a5ce4acef31ebf08ccde32a5a17cd 100644 --- a/library/ZendAfi/View/Helper/Menu/Entry.php +++ b/library/ZendAfi/View/Helper/Menu/Entry.php @@ -75,7 +75,12 @@ class ZendAfi_View_Helper_Menu_Entry extends ZendAfi_View_Helper_Menu_Base { public function getTagAnchor() { $modMenus = new Class_Systeme_ModulesMenu(); - $params = $modMenus->getUrl($this->_type_module, $this->_menu); + $preferences = $this->_menu; + + if(isset($preferences['preferences'])) + $preferences = array_merge($preferences, $preferences['preferences']); + + $params = $modMenus->getUrl($this->_type_module, $preferences); $url = $params['url']; $img_URL = URL_IMG.'menus/'; diff --git a/tests/application/modules/admin/controllers/ModulesControllerTest.php b/tests/application/modules/admin/controllers/ModulesControllerTest.php index 4324ceb7f14d383b55511a06ef2dc026273a1bcb..443a71b644f1ac53453d9c63fe28e8bf60d02761 100644 --- a/tests/application/modules/admin/controllers/ModulesControllerTest.php +++ b/tests/application/modules/admin/controllers/ModulesControllerTest.php @@ -339,8 +339,14 @@ class ModulesControllerRechercheViewnoticeEmptyLinksZonesPostTest /** @test */ - public function shouldNotHaveErrors() { - $this->assertNotXPath('//ul[@class="error"]'); + public function withNoErrorsShouldRedirect() { + $this->assertRedirect(); + } + + + /** @test */ + public function notifyShouldContainsSuccessMessage() { + $this->assertFlashMessengerContentContains('La configuration a été enregistrée'); } } diff --git a/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php b/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php index 74ade51703b530fb2f176f7451c94365dc533a01..e6e1ae2b20fefbfa07e0d1e08a8a3e92b96ac452 100644 --- a/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php +++ b/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php @@ -130,13 +130,13 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll /** @test */ public function boitePretsShouldBeAvailable() { - $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="PRETS"]','Mes prêts'); + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="PRETS"]','prêts'); } /** @test */ public function domainBrowserModuleShouldBeAvailable() { - $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="DOMAIN_BROWSER"]','Domaines'); + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="DOMAIN_BROWSER"]','domaines'); } /** @test */ @@ -147,13 +147,13 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll /** @test */ public function boiteReservationsShouldBeAvailable() { - $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="RESERVATIONS"]','Mes réservations'); + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="RESERVATIONS"]','réservations'); } /** @test */ public function boitePanierShouldBeAvailable() { - $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="PANIER"]','Mes paniers'); + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="PANIER"]','paniers'); } @@ -165,13 +165,13 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll /** @test */ public function boiteHistoriqueRecherchesShouldBeAvailable() { - $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="HISTORIQUE_RECHERCHES"]','Historique recherches'); + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="HISTORIQUE_RECHERCHES"]','historique recherches'); } /** @test */ public function boiteFormationsShouldBeAvailable() { - $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="FORMATIONS_WIDGET"]','Formations'); + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="FORMATIONS_WIDGET"]','formations'); } @@ -277,7 +277,7 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll $news = $profil_jeunesse->getModuleAccueilConfig(2, 'NEWS'); $this->assertEquals(1, $news['division']); $this->assertEquals('NEWS', $news['type_module']); - $this->assertEquals('Articles', $news['preferences']['titre']); + $this->assertEquals('Boite articles', $news['preferences']['titre']); } diff --git a/tests/application/modules/admin/controllers/ProfilControllerTest.php b/tests/application/modules/admin/controllers/ProfilControllerTest.php index 97042488dda8a729b1a2c556c7a61f128b0ed6b5..adb8fe9c2c6394aa4c6d7a4eaad0d316be06bb78 100644 --- a/tests/application/modules/admin/controllers/ProfilControllerTest.php +++ b/tests/application/modules/admin/controllers/ProfilControllerTest.php @@ -414,7 +414,7 @@ class Admin_ProfilControllerProfilJeunesseTestMenusMaj extends Admin_ProfilContr ->newInstanceWithId('FORMATIONS') ->setValeur('1'); $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit', true); - $this->assertXPathContentContains('//option', 'Formations'); + $this->assertXPathContentContains('//option', 'formations'); } @@ -424,7 +424,7 @@ class Admin_ProfilControllerProfilJeunesseTestMenusMaj extends Admin_ProfilContr ->newInstanceWithId('FORMATIONS') ->setValeur('0'); $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit',true); - $this->assertNotXPathContentContains('//option', 'Formations'); + $this->assertNotXPathContentContains('//option', 'formations'); } @@ -454,7 +454,7 @@ class Admin_ProfilControllerProfilJeunesseTestMenusMaj extends Admin_ProfilContr ->newInstanceWithId('MULTIMEDIA_KEY') ->setValeur('I love multimedia'); $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit'); - $this->assertXPathContentContains('//option', 'Réserver un poste multimédia'); + $this->assertXPathContentContains('//option', 'un poste multimédia'); } @@ -483,8 +483,8 @@ l66WXceACmsgGWEdHMB7ZPUd4HqR5bdE1Xnr1Q0Z9IIku6Naxt/yy0P5Gv+ZlW7U ['valeur' => 'http://resa.zebib.net']); - $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit'); - $this->assertXPathContentContains('//option', 'Réserver un poste Webkiosk'); + $this->dispatch('admin/widget/edit-menu/id_profil/5/id/H'); + $this->assertXPathContentContains('//li', 'poste Webkiosk'); } @@ -496,23 +496,23 @@ l66WXceACmsgGWEdHMB7ZPUd4HqR5bdE1Xnr1Q0Z9IIku6Naxt/yy0P5Gv+ZlW7U Class_AdminVar::newInstanceWithId('WEBKIOSK_RESERVATION_URL', ['valeur' => null]); - $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit'); - $this->assertNotXPathContentContains('//option', 'Réserver un poste Webkiosk'); + $this->dispatch('admin/widget/edit-menu/id_profil/5/id/H'); + $this->assertNotXPathContentContains('//option', 'poste Webkiosk'); } /** @test */ public function registerLinkShouldBePresent() { - $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit'); - $this->assertXPathContentContains('//optgroup[@label="Navigation"]//option', 'S\'enregistrer'); + $this->dispatch('admin/widget/edit-menu/id_profil/5/id/H'); + $this->assertXPathContentContains('//li', 'enregistrement'); } /** @test */ public function preRegistrationLinkShouldBePresent() { - $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit'); - $this->assertXPathContentContains('//optgroup[@label="Navigation"]//option', 'Se préinscrire'); + $this->dispatch('admin/widget/edit-menu/id_profil/5/id/H'); + $this->assertXPathContentContains('//li', 'préinscription'); } } @@ -1173,7 +1173,7 @@ class Admin_ProfilControllerPostAccueilPageMusiqueWithErrorsTest extends Admin_P /** @test */ public function domainBrowserModuleShouldBeAvailable() { - $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="DOMAIN_BROWSER"]','Domaines'); + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="DOMAIN_BROWSER"]','domaines'); } @@ -1414,29 +1414,29 @@ class Admin_ProfilControllerEditMenuHorizontalTest extends Admin_AbstractControl Class_Systeme_ModulesMenu::reset(); Class_AdminVar::newInstanceWithId('MENU_BOITE', ['valeur' => '1']); - $this->dispatch('admin/profil/menusmaj/id_profil/5/id_menu/H/mode/edit', true); + $this->dispatch('admin/widget/edit-menu/id_profil/5/id/H', true); } /** @test */ public function tdShouldContainsPratique() { - $this->assertXPathContentContains("//td/span","Pratique"); + $this->assertXPathContentContains("//li","Pratique"); } /** @test */ public function selectOptionShouldContainsMenu() { - $this->assertXPathContentContains("//td/select/option","Menu"); + $this->assertXPathContentContains("//li","Menu"); } /** @test */ public function selectOptgroupShouldContainsModulesInformations() { - $this->assertXPath("//td//optgroup[@label='Modules informations']",$this->_response->getBody()); + $this->assertXPath("//li"); } /** @test */ public function selectOptionShouldContainsBoiteDeuxColonnes() { - $this->assertXPathContentContains("//td//select//option", "Boite deux colonnes", $this->_response->getBody()); + $this->assertXPathContentContains("//li", "Boite deux colonnes"); } } diff --git a/tests/application/modules/admin/controllers/WidgetControllerTest.php b/tests/application/modules/admin/controllers/WidgetControllerTest.php index 0d39b4ba4453aa008e7b6b7804a2096ae13c27e8..235fec888876ff67e9bd633f47acf4df2ea2824c 100644 --- a/tests/application/modules/admin/controllers/WidgetControllerTest.php +++ b/tests/application/modules/admin/controllers/WidgetControllerTest.php @@ -444,7 +444,7 @@ class WidgetControllerArticlesPopupDispatchTest extends WidgetControllerPopupDis /** @test */ public function titleShouldBeNewsModuleProperties() { - $this->assertEquals($this->_html->title, 'Articles'); + $this->assertEquals($this->_html->title, 'Boite articles'); } } @@ -706,7 +706,7 @@ class WidgetControllerReviewsDispatchTest extends WidgetControllerDispatchWidget /** @test */ public function titleShouldBePresent() { - $this->assertXPathContentContains('//h1', 'Critiques'); + $this->assertXPathContentContains('//h1', 'critiques'); } @@ -1079,7 +1079,7 @@ class WidgetControllerBibNumericTest extends WidgetControllerDispatchWidgetConfi /** @test */ public function frameTitleShouldBeProprieteDeLaBibliothequeNumerique() { - $this->assertXPathContentContains('//h1', 'Bibliothèque numérique'); + $this->assertXPathContentContains('//h1', 'bibliothèque numérique'); } @@ -1320,7 +1320,7 @@ class WidgetControllerRSSSimpleTest extends WidgetControllerDispatchWidgetConfig /** @test */ public function inputTitleShouldDisplayFilsRss() { - $this->assertXPath("//input[@name='titre'][@value='Fils RSS']"); + $this->assertXPath("//input[@name='titre'][@value='Boite RSS']"); } @@ -1676,7 +1676,7 @@ class WidgetControllerDomainBrowserDispatchTest extends WidgetControllerDispatch /** @test **/ public function inputTitleWidgetShouldBeDisplay() { - $this->assertXpath('//input[@name="titre"][@value="Domaines"]'); + $this->assertXpath('//input[@name="titre"][@value="Boite domaines"]'); } @@ -1785,7 +1785,7 @@ class WidgetControllerLibrarySimpleDispatchTest extends WidgetControllerDispatch /** @test */ public function h1ShouldContainsLibraryProperties() { - $this->assertXPathContentContains('//h1', 'Bibliothèques'); + $this->assertXPathContentContains('//h1', 'bibliothèques'); } diff --git a/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php b/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php index 3966633cdda6308e6491631a01424bcbb5afd7b4..4b41858d1cf9c179f65bbaad9f99a2bef7e09fe3 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php @@ -780,7 +780,7 @@ class AbonneControllerAvisBlogControllerViewCritiquesWithoutModuleTest extends M /** @test */ public function titleShouldBeDernieresCritiques() { $this->dispatch('/opac/blog/viewcritiques'); - $this->assertXPathContentContains('//h1', 'Critiques'); + $this->assertXPathContentContains('//h1', 'critiques'); } } diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php index 7b7e66f9c115aafa9f49cc33b499ebb6da665f12..f52fdc9353f86a9ebca1ffe24adfcfb9e7d7f567 100644 --- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php +++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php @@ -547,7 +547,7 @@ class ProfilOptionsControllerViewProfilAdulteTest extends ProfilOptionsControlle /** @test */ public function menuHorizontalShouldIncludeExternalLinkToGoogle() { - $this->assertXPathContentContains("//div[@id='menu_horizontal']//li//a[@href='http://www.google.com'][@target='_blank']", + $this->assertXPathContentContains("//div[@id='menu_horizontal']//li//a[@target='_blank']", 'Google'); } @@ -645,8 +645,7 @@ class ProfilOptionsControllerViewProfilAdulteTest extends ProfilOptionsControlle /** @test */ public function menuHorizontalShouldIncludeLinkToSimpleSearch() { - $this->assertXPathContentContains("//div[@id='menu_horizontal']//li[@class='menu']//a[@href='/recherche/simple/statut/reset']", - 'Recherche simple'); + $this->assertXPathContentContains("//div[@id='menu_horizontal']//li[@class='menu']//a[@href='/recherche/simple/statut/reset/id_profil/4']"); } @@ -721,7 +720,7 @@ class ProfilOptionsControllerViewProfilAdulteTest extends ProfilOptionsControlle /** @test */ public function menuHorizontalForProfilJeunesseShouldHaveUrlIdProfil230NotSelected() { $this->assertXPathContentContains('//ul/li[not(contains(@class, "selected_profil"))]/a[contains(@href, "/id_profil/230")]', - 'Profil jeunesse', $this->_response->getBody()); + 'Profil jeunesse'); } /** @test */ @@ -1153,7 +1152,7 @@ class ProfilOptionsControllerPageJeuxViewModuleCritiquesTest extends ProfilOptio /** @test */ public function iframeKiosqueUrlShouldHaveIdModuleSeven() { - $this->assertXPath('//iframe[contains(@src, "/id_module/7/id_profil/12/vue/cube")][@title="Kiosque de documents"]'); + $this->assertXPath('//iframe[contains(@src, "/id_module/7/id_profil/12/vue/cube")][contains(@title, "kiosque")]'); } @@ -1332,7 +1331,7 @@ class ProfilOptionsControllerProfilJeunesseViewPageJeuxTest extends ProfilOption /** @test */ public function boiteKiosqueTitleShouldLinkToMenuCatalogue() { - $this->assertXPath("//div[@class='boite kiosque']//div//a[contains(@href, '/recherche/simple/titre/Kiosque+de+documents/style_liste/cube/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/90/op_transition//op_largeur_img/0/op_hauteur_boite/0/op_captions/0/op_autoplay/0/op_visible/0/op_speed/0/op_auto/0/op_scroll/1/rss_avis/1/id_catalogue/0/id_panier/0/profil_redirect//boite/boite_de_la_division_gauche')]"); + $this->assertXPath("//div[@class='boite kiosque']//div//a[contains(@href, '/recherche/simple/titre/Boite+kiosque/style_liste/cube/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/90/op_transition//op_largeur_img/0/op_hauteur_boite/0/op_captions/0/op_autoplay/0/op_visible/0/op_speed/0/op_auto/0/op_scroll/1/rss_avis/1/id_catalogue/0/id_panier/0/profil_redirect//boite/boite_de_la_division_gauche')]"); } @@ -1617,7 +1616,7 @@ class ProfilOptionsControllerViewProfilJeunesseAccueilTest extends ProfilOptions /** @test */ public function boiteNewsShouldBeVisibleInProfilJeunesse() { - $this->assertXPathContentContains("//a[contains(@href, 'articleviewselection')]",'Articles'); + $this->assertXPathContentContains("//a[contains(@href, 'articleviewselection')]",'articles'); } diff --git a/tests/library/Class/ProfilTest.php b/tests/library/Class/ProfilTest.php index 84a48610802ee995f08aa9d3156c939261fb4b04..a7b5c18f83027e813422a0dd13da7147ffe4423a 100644 --- a/tests/library/Class/ProfilTest.php +++ b/tests/library/Class/ProfilTest.php @@ -151,7 +151,7 @@ class ProfilJeunesseAstrolabeTest extends ModelTestCase { /** @test */ public function getOrCreateConfigAccueilRechSimpleShouldCreatePreferences() { $data = $this->profil_astro->getOrCreateConfigAccueil(1, 'RECH_SIMPLE'); - $this->assertEquals('Recherche', $data['titre']); + $this->assertEquals('boite recherche', $data['titre']); } @@ -1068,7 +1068,7 @@ class ProfilEvenementsTest extends ModelTestCase { /** @test */ public function boiteRechercheSimpleTitreShouldBeRechercher() { - $this->assertEquals('Recherche', $this->boite_recherche['preferences']['titre']); + $this->assertEquals('Boite recherche', $this->boite_recherche['preferences']['titre']); } diff --git a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php index c77c2fb95cc9a0de18e0e9c7f6889981fb59a0ce..592faa5c96cdc9f1bd38e96bfa75350c0b418f7f 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php @@ -520,7 +520,7 @@ class ZendAfi_View_Helper_Accueil_KiosqueProfileRedirectTest extends ViewHelperT [[$this->getPreferencesWith('mur','142'), '//a[contains(@href, "id_profil/142")][contains(@href, "id_module/2-3")]'], [$this->getPreferencesWith('vignettes', '142'), '//a[contains(@href, "id_profil/142")][contains(@href, "id_module/2-3")]'], [$this->getPreferencesWith('chrono', '142'), '//script[contains(., "id_profil\\/142")][contains(., "id_module\\/2-3")]'], - [$this->getPreferencesWith('slide_show', '142'), '//iframe[contains(@src, "id_profil/142")][contains(@src, "id_module/2-3")][contains(@title, "Kiosque")]'], + [$this->getPreferencesWith('slide_show', '142'), '//iframe[contains(@src, "id_profil/142")][contains(@src, "id_module/2-3")][contains(@title, "Boite kiosque")]'], [$this->getPreferencesWith('protoflow', '142'), '//iframe[contains(@src, "id_profil/142")][contains(@src, "id_module/2-3")]'], [$this->getPreferencesWith('cube', '142'), '//iframe[contains(@src, "id_profil/142")][contains(@src, "id_module/2-3")]'], [$this->getPreferencesWith('diaporama', '142'), '//iframe[contains(@src, "id_profil/142")][contains(@src, "id_module/2-3")]'], diff --git a/tests/scenarios/MultiCards/MultiCardsTest.php b/tests/scenarios/MultiCards/MultiCardsTest.php index 641812a295013af5b8517b2118138ae091a0e6fe..8e000b7251ed3226bd84ab4229a27d1b74a61053 100644 --- a/tests/scenarios/MultiCards/MultiCardsTest.php +++ b/tests/scenarios/MultiCards/MultiCardsTest.php @@ -977,7 +977,7 @@ class Scenario_AbonneMultiCardsAdminMenu extends Admin_AbstractControllerTestCas /** @test */ public function profilMenusSelectShouldContainsEntryFormMyCards() { $this->dispatch('/admin/profil/menusmaj/id_profil/2/id_menu/H/mode/edit', true); - $this->assertXPathContentContains('//select[@name="type_menu"]//option[@value="ABON_CARDS"]', 'Cartes'); + $this->assertXPathContentContains('//select[@name="type_menu"]//option[@value="ABON_CARDS"]', 'cartes'); } diff --git a/tests/scenarios/Widgets/WidgetsTest.php b/tests/scenarios/Widgets/WidgetsTest.php index c6916d9c04824f18b4819a4520a141490e04fa78..5a4540256756b6a97d792de1ea55c24bfea0e552 100644 --- a/tests/scenarios/Widgets/WidgetsTest.php +++ b/tests/scenarios/Widgets/WidgetsTest.php @@ -315,6 +315,7 @@ class WidgetsDispatchAllMenusTest extends Admin_AbstractControllerTestCase { + class WidgetsNavMenuPostTest extends Admin_AbstractControllerTestCase { protected $_storm_default_to_volatile = true;