/**
  * Checks the render method
  */
 public function testRender()
 {
     $scaleControlTest = new ScaleControl();
     $scaleControlTest->setControlPosition(ControlPosition::BOTTOM_CENTER);
     $scaleControlTest->setScaleControlStyle(ScaleControlStyle::DEFAULT_);
     $this->assertEquals(self::$scaleControlHelper->render($scaleControlTest), '{"position":google.maps.ControlPosition.BOTTOM_CENTER,"style":google.maps.ScaleControlStyle.DEFAULT}');
 }
 /**
  * Create a scale control
  */
 public function __construct()
 {
     parent::__construct();
 }
 /**
  * Checks the map scale control getter & setter
  */
 public function testScaleControl()
 {
     $scaleControlTest = new Controls\ScaleControl();
     $scaleControlTest->setControlPosition(Controls\ControlPosition::BOTTOM_CENTER);
     $scaleControlTest->setScaleControlStyle(Controls\ScaleControlStyle::DEFAULT_);
     $this->assertFalse(self::$map->hasScaleControl());
     $this->assertFalse(self::$map->hasMapOption('scaleControl'));
     self::$map->setScaleControl($scaleControlTest);
     $this->assertTrue(self::$map->hasScaleControl());
     $this->assertEquals(self::$map->getScaleControl()->getControlPosition(), 'bottom_center');
     $this->assertEquals(self::$map->getScaleControl()->getScaleControlStyle(), 'default');
     $this->assertTrue(self::$map->hasMapOption('scaleControl'));
     self::$map->setScaleControl(Controls\ControlPosition::BOTTOM_LEFT, Controls\ScaleControlStyle::DEFAULT_);
     $this->assertEquals(self::$map->getScaleControl()->getControlPosition(), 'bottom_left');
     $this->assertEquals(self::$map->getScaleControl()->getScaleControlStyle(), 'default');
     self::$map->setScaleControl(null);
     $this->assertNull(self::$map->getScaleControl());
     $this->assertFalse(self::$map->hasMapOption('scaleControl'));
     $this->setExpectedException('InvalidArgumentException');
     self::$map->setScaleControl('foo');
 }
 /**
  * Renders the scale control
  *
  * @param Ivory\GoogleMapBundle\Model\Controls\ScaleControl $scaleControl
  * @return string HTML output
  */
 public function render(ScaleControl $scaleControl)
 {
     return sprintf('{"position":%s,"style":%s}', $this->controlPositionHelper->render($scaleControl->getControlPosition()), $this->scaleControlStyleHelper->render($scaleControl->getScaleControlStyle()));
 }