public function testRender() { $map = $this->getMock('Ivory\\GoogleMap\\Map'); $map->expects($this->once())->method('getJavascriptVariable')->will($this->returnValue('map')); $circle = new Circle(); $circle->setJavascriptVariable('circle'); $circle->setCenter(1.1, 2.1, true); $circle->getCenter()->setJavascriptVariable('center'); $circle->setRadius(2); $circle->setOptions(array('option1' => 'value1', 'option2' => 'value2')); $expected = 'circle = new google.maps.Circle({' . '"map":map,' . '"center":center,' . '"radius":2,' . '"option1":"value1",' . '"option2":"value2"' . '});' . PHP_EOL; $this->assertSame($expected, $this->circleHelper->render($circle, $map)); }
/** * @expectedException \Ivory\GoogleMap\Exception\OverlayException * @expectedExceptionMessage * The center setter arguments is invalid. * The available prototypes are : * - function setCenter(Ivory\GoogleMap\Base\Coordinate $center) * - function setCenter(double $latitude, double $longitude, boolean $noWrap = true) */ public function testCenterWithInvalidValue() { $this->circle->setCenter('foo'); }