diff --git a/VERSIONS_HOTLINE/115685 b/VERSIONS_HOTLINE/115685 new file mode 100644 index 0000000000000000000000000000000000000000..b5942950c9e7defaf7d4936385bcd814b6c63dc7 --- /dev/null +++ b/VERSIONS_HOTLINE/115685 @@ -0,0 +1 @@ + - ticket #115685 : Menus : correction de la saisie d'URLs contenant des tirets bas _ \ No newline at end of file diff --git a/library/storm b/library/storm index 37869557bee900aefa9718239f3d6c0da80e7177..2b5c85fe5664378b8405e5dc235a624f7f34e836 160000 --- a/library/storm +++ b/library/storm @@ -1 +1 @@ -Subproject commit 37869557bee900aefa9718239f3d6c0da80e7177 +Subproject commit 2b5c85fe5664378b8405e5dc235a624f7f34e836 diff --git a/tests/library/ZendAfi/Validate/UrlTest.php b/tests/library/ZendAfi/Validate/UrlTest.php index 7982e393b910b6a975e92c8143c08ae9123fe4c0..89129e10c13e6e31ad6ec0c08f64e33cf137e75e 100644 --- a/tests/library/ZendAfi/Validate/UrlTest.php +++ b/tests/library/ZendAfi/Validate/UrlTest.php @@ -30,6 +30,7 @@ class UrlTest extends PHPUnit_Framework_TestCase { ['/images/manchot.png'], ['http://www.linuxfr.org'], ['https://www.linux.fr.org/news'], + ['/no_services/#test'] ]; } diff --git a/tests/scenarios/Templates/TemplatesMenuTest.php b/tests/scenarios/Templates/TemplatesMenuTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3dff26a39f350204f7d954b41430722cb6ba0ec0 --- /dev/null +++ b/tests/scenarios/Templates/TemplatesMenuTest.php @@ -0,0 +1,123 @@ +<?php +/** + * Copyright (c) 2012-2020, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +require_once 'TemplatesTest.php'; + + +class TemplatesMenuDispatchEditMenuHTest extends TemplatesIntonationTestCase { + + public function setUp() { + parent::setUp(); + Class_Profil::setCurrentProfil(Class_Profil::find(2)); + $this->dispatch('/admin/widget/edit-menu/id/H/id_profil/72', true); + } + + + /** @test */ + public function elementsShouldNotBeHydrated() { + $this->assertNotXPath('//label[contains(@class, "col")]'); + } + + + /** @test */ + public function currentProfileShouldBe2() { + $this->assertEquals(2, Class_Profil::getCurrentProfil()->getId()); + } + + + /** @test */ + public function inputPictoTypeShouldBeText() { + $this->assertXpath('//input[@name="picto"][@type="text"]'); + } + + + /** @test */ + public function inputPictoAltShouldBePresent() { + $this->assertXpath('//input[@name="picto_alt"][@type="text"]'); + } +} + + + +abstract class TemplatesMenuUrlTestCase extends TemplatesIntonationTestCase { + public function setUp(){ + parent::setUp(); + + Class_Profil::find(72) + ->setCfgMenuHorizontal( + ['libelle' => 'News', + 'picto' => 'news.png', + 'menus' => [['type_menu' => 'URL', + 'libelle' => 'url de lien vers site', + 'picto' => 'toto.gif', + 'preferences' => ['url'=>'http://www.framasoft.org/'] + ]]]); + } +} + + + + +class TemplatesMenuUrlFormTest extends TemplatesMenuUrlTestCase { + public function setUp() { + parent::setUp(); + + $this->dispatch('/admin/widget/edit-menu/id/0/id_profil/72/parent/H'); + } + + + /** @test */ + public function inputUrlShouldContainsFramasoftDotOrg() { + $this->assertXPath('//input[@id="url"][@value="http://www.framasoft.org/"]'); + } + + + /** @test */ + public function inputLibelleShouldContainsUrlDeLienVersSite() { + $this->assertXPath('//input[@id="libelle"][@value="url de lien vers site"]'); + } +} + + + + +class TemplatesMenuUrlEditTest extends TemplatesMenuUrlTestCase { + public function setUp() { + parent::setUp(); + + $this->postDispatch('/admin/widget/edit-menu/id/0/id_profil/72/parent/H', + ['url' => '/taches_reseau_2#test', + 'libelle' => 'mon réseau'] + ); + } + + + /** @test */ + public function responseShouldBeRedirect() { + $this->assertRedirect(); + } + + + /** @test */ + public function menuUrlShouldBeTachesReseau() { + $this->assertEquals('/taches_reseau_2#test', + Class_Profil::find(72)->getCfgMenuHorizontal()[0]['preferences']['url']); + } +} \ No newline at end of file diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index 844facb980744bd64f00459d09563c86b2b07824..e162b8678b1111aa2ac9192121475ecc4a740d78 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -644,42 +644,6 @@ class TemplatesDispatchIntonationTest extends TemplatesIntonationTestCase { -class TemplatesDispatchEditMenuHTest extends TemplatesIntonationTestCase { - - public function setUp() { - parent::setUp(); - Class_Profil::setCurrentProfil(Class_Profil::find(2)); - $this->dispatch('/admin/widget/edit-menu/id/H/id_profil/72', true); - } - - - /** @test */ - public function elementsShouldNotBeHydrated() { - $this->assertNotXPath('//label[contains(@class, "col")]'); - } - - - /** @test */ - public function currentProfileShouldBe2() { - $this->assertEquals(2, Class_Profil::getCurrentProfil()->getId()); - } - - - /** @test */ - public function inputPictoTypeShouldBeText() { - $this->assertXpath('//input[@name="picto"][@type="text"]'); - } - - - /** @test */ - public function inputPictoAltShouldBePresent() { - $this->assertXpath('//input[@name="picto_alt"][@type="text"]'); - } -} - - - - class TemplatesDispatchEditSectionTest extends TemplatesIntonationTestCase { public function setUp() {