Commit bf24f3b0 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

holtine #74837 fix osm rendering

parent ca7c3514
- ticket #74837 : correction de l'affichage du plan d'accès Open Street Map à partir de la fiche bibliothèque.
\ No newline at end of file
......@@ -51,8 +51,8 @@ class ZendAfi_View_Helper_LibrariesMap extends ZendAfi_View_Helper_BaseHelper {
: '');
$osm_layer = json_encode(isset($preferences['osm_layer'])
? $preferences['osm_layer']
: '0');
? $preferences['osm_layer']
: 1);
return $this->_tag('div', '', ['id' => $container_id,
'class' => 'leaflet_osm',
......
......@@ -73,4 +73,41 @@ class ZendAfi_View_Helper_Accueil_LibrariesMapTest extends ViewHelperTestCase {
public function dataOsmLayerShouldBe1() {
$this->assertXPath($this->html, '//div[contains(@data-osm-layer, "1")]');
}
}
class ZendAfi_View_Helper_Accueil_LibrariesMapWithOutPreferencesTest extends ViewHelperTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->fixture('Class_Lieu',
['id' => 78,
'libelle' => 'Cran-Gevrier']);
$this->fixture('Class_Lieu',
['id' => 65,
'libelle' => 'Valleiry']);
$libraries = [$this->fixture('Class_Bib', ['id' => 3,
'libelle' => 'Cran-Gévrier',
'id_lieu' => 78]),
$this->fixture('Class_Bib', ['id' => 89,
'libelle' => 'Valleiry',
'id_lieu' => 65])];
$this->_helper = new ZendAfi_View_Helper_LibrariesMap();
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->html = $this->_helper->librariesMap($libraries, '1');
}
/** @test */
public function osmLayerShouldBe1() {
$this->assertXpath($this->html, '//div[@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