Commit 6904ff72 authored by efalcy's avatar efalcy

Merge branch 'hotline#113792_pb_chargement_fichier_geojson_version_magasin_de_theme' into 'hotline'

hotline #113792 : Templaiting / Library Widget / OSM Map : fix geojson loading

See merge request !3568
parents 759ed1f5 8080f865
Pipeline #10527 passed with stage
in 43 minutes and 49 seconds
- ticket #113792 : Magasin de thème / boîte bibliothèque : correction du chargement du fichier geojson
\ No newline at end of file
......@@ -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()]))
: '';
}
......
......@@ -5466,4 +5466,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
Markdown is supported
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