diff --git a/VERSIONS_HOTLINE/113792 b/VERSIONS_HOTLINE/113792 new file mode 100644 index 0000000000000000000000000000000000000000..a3c35b5f35dc25af84190d2f70cea269f71f165c --- /dev/null +++ b/VERSIONS_HOTLINE/113792 @@ -0,0 +1 @@ + - ticket #113792 : Magasin de thème / boîte bibliothèque : correction du chargement du fichier geojson \ No newline at end of file diff --git a/library/templates/Intonation/View/LibrariesWidget.php b/library/templates/Intonation/View/LibrariesWidget.php index a7661b178c09d269187eaed0cb63566e4684a026..52623dfebaa4f786e15499dcfdc355fe206ec1ca 100644 --- a/library/templates/Intonation/View/LibrariesWidget.php +++ b/library/templates/Intonation/View/LibrariesWidget.php @@ -72,7 +72,7 @@ class Intonation_View_LibrariesWidget extends ZendAfi_View_Helper_BaseHelper { ['fields' => $fields, 'linked' => 1, 'osm_layer' => $this->_settings->getOsmLayer(), - 'osm_geojson' => $this->_settings->getOsmGeojson()])) + 'geo_json' => $this->_settings->getGeoJson()])) : ''; } diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index 72300fcd4184866e54cb4876bd4708142b62a52a..3d12fb681b6e5514029dd8e4c62bbe4783232cf2 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -5409,4 +5409,56 @@ class TemplatesSuggestionAchatAddTest extends TemplatesIntonationTestCase { $this->assertXPathContentContains('//title', 'Suggérer un achat'); } +} + + + + +class TemplatesDispatchLibraryWidgetWithOSMTest extends TemplatesIntonationTestCase { + public function setUp() { + parent::setUp(); + + $this->fixture('Class_Bib', + ['id' => 1, + 'libelle' => 'Annecy', + 'lieu' => $this->fixture('Class_Lieu', + ['id' => 9, + 'libelle' => 'Annecy', + 'latitude' => '1', + 'longitude' => '1'])]); + + Class_Profil::find(72) + ->setCfgAccueil(['modules' => + ['21' => ['division' => 3, + 'type_module' => 'LIBRARY', + 'preferences' => ['osm_map' => 1, + 'osm_layer' => 1, + 'geo_json' => 'files/my_geojson.geojson']]]]) + ->assertSave(); + $this->dispatch('/opac/index/index/id_profil/72'); + } + + + /** @test */ + public function scriptLoaderShouldContainsOpenStreetMapJs() { + $this->assertContains('openStreetMap.js', Class_ScriptLoader::getInstance()->html()); + } + + + /** @test */ + public function scriptLoaderShouldContainsOpenStreetMapCss() { + $this->assertContains('openStreetMap.css', Class_ScriptLoader::getInstance()->html()); + } + + + /** @test */ + public function dataOsmGeoJsonShouldContainsMyGeoJson() { + $this->assertXPath('//div[contains(@data-osm-geojson, "my_geojson.geojson")]'); + } + + + /** @test */ + public function dataOsmLayerShouldBe1() { + $this->assertXPath('//div[contains(@data-osm-layer, "1")]'); + } } \ No newline at end of file