コード例 #1
0
 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));
 }
コード例 #2
0
 /**
  * @expectedException \Ivory\GoogleMap\Exception\OverlayException
  * @expectedExceptionMessage The radius of a circle must be a numeric value.
  */
 public function testRadiusWithInvalidValue()
 {
     $this->circle->setRadius(true);
 }