@@ -21,15 +21,15 @@ public function testWithMinimalConfiguration(): void
2121 {
2222 $ leafletOptions = new LeafletOptions ();
2323
24- $ array = $ leafletOptions ->toArray ();
25-
2624 self ::assertSame ([
2725 'tileLayer ' => [
2826 'url ' => 'https://tile.openstreetmap.org/{z}/{x}/{y}.png ' ,
2927 'attribution ' => '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' ,
30- 'options ' => $ array [ ' tileLayer ' ][ ' options ' ], // stdClass
28+ 'options ' => [],
3129 ],
32- ], $ array );
30+ ], $ leafletOptions ->toArray ());
31+
32+ self ::assertEquals ($ leafletOptions , LeafletOptions::fromArray ($ leafletOptions ->toArray ()));
3333 }
3434
3535 public function testWithMaximumConfiguration (): void
@@ -47,18 +47,19 @@ public function testWithMaximumConfiguration(): void
4747 ),
4848 );
4949
50- $ array = $ leafletOptions ->toArray ();
51-
5250 self ::assertSame ([
5351 'tileLayer ' => [
5452 'url ' => 'https://tile.openstreetmap.org/{z}/{x}/{y}.png ' ,
5553 'attribution ' => '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' ,
56- 'options ' => $ array ['tileLayer ' ]['options ' ], // stdClass
54+ 'options ' => [
55+ 'maxZoom ' => 19 ,
56+ 'minZoom ' => 1 ,
57+ 'maxNativeZoom ' => 18 ,
58+ 'zoomOffset ' => 0 ,
59+ ],
5760 ],
58- ], $ array );
59- self ::assertSame (19 , $ array ['tileLayer ' ]['options ' ]->maxZoom );
60- self ::assertSame (1 , $ array ['tileLayer ' ]['options ' ]->minZoom );
61- self ::assertSame (18 , $ array ['tileLayer ' ]['options ' ]->maxNativeZoom );
62- self ::assertSame (0 , $ array ['tileLayer ' ]['options ' ]->zoomOffset );
61+ ], $ leafletOptions ->toArray ());
62+
63+ self ::assertEquals ($ leafletOptions , LeafletOptions::fromArray ($ leafletOptions ->toArray ()));
6364 }
6465}
0 commit comments