public function testRenderWithGeotagAndCaption() { $script = <<<'JSON' { "type": "Feature", "geometry": { "type": "Point", "coordinates": [23.166667, 89.216667] }, "properties": { "title": "Jessore, Bangladesh", "radius": 750000, "pivot": true, "style": "satellite" } } JSON; $map = Map::create()->withGeoTag(GeoTag::create()->withScript($script))->withCaption(Caption::create()->withTitle('Title of Image caption')->withCredit('Some caption to the image')->withPosition(Caption::POSITION_BELOW)); $expected = '<figure class="op-map">' . '<script type="application/json" class="op-geotag">' . $script . '</script>' . '<figcaption class="op-vertical-below">' . '<h1>Title of Image caption</h1>' . '<cite>Some caption to the image</cite>' . '</figcaption>' . '</figure>'; $rendered = $map->render(); $this->assertEquals($expected, $rendered); }
public function testRenderWithGeotag() { $script = <<<'JSON' { "type": "Feature", "geometry": { "type": "Point", "coordinates": [23.166667, 89.216667] }, "properties": { "title": "Jessore, Bangladesh", "radius": 750000, "pivot": true, "style": "satellite" } } JSON; $geo_tag = GeoTag::create()->withScript($script); $expected = '<script type="application/json" class="op-geotag">' . $script . '</script>'; $rendered = $geo_tag->render(); $this->assertEquals($expected, $rendered); }
public function testRenderWithGeotag() { $script = <<<'JSON' { "type": "Feature", "geometry": { "type": "Point", "coordinates": [23.166667, 89.216667] }, "properties": { "title": "Jessore, Bangladesh", "radius": 750000, "pivot": true, "style": "satellite" } } JSON; $image = Image::create()->withURL('https://jpeg.org/images/jpegls-home.jpg')->withGeoTag(GeoTag::create()->withScript($script)); $expected = '<figure>' . '<img src="https://jpeg.org/images/jpegls-home.jpg"/>' . '<script type="application/json" class="op-geotag">' . $script . '</script>' . '</figure>'; $rendered = $image->render(); $this->assertEquals($expected, $rendered); }
public function testRenderWithGeotag() { $geotag = <<<'JSON' { "type": "Feature", "geometry": { "type": "Point", "coordinates": [23.166667, 89.216667] }, "properties": { "title": "Jessore, Bangladesh", "radius": 750000, "pivot": true, "style": "satellite" } } JSON; $video = Video::create()->withURL('http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4')->withGeoTag(GeoTag::create()->withScript($geotag)); $expected = '<figure>' . '<video>' . '<source src="http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4"/>' . '</video>' . '<script type="application/json" class="op-geotag">' . $geotag . '</script>' . '</figure>'; $rendered = $video->render(); $this->assertEquals($expected, $rendered); }