public function testSignUrlWithBusinessAccount() { $url = 'http://maps.googleapis.com/maps/api/staticmap?center=%E4%B8%8A%E6%B5%B7+%E4%B8%AD%E5%9C%8B&size=640x640&zoom=10&sensor=false'; $businessAccount = $this->getMockBuilder('Ivory\\GoogleMap\\Services\\BusinessAccount')->disableOriginalConstructor()->getMock(); $businessAccount->expects($this->once())->method('signUrl')->with($this->equalTo($url))->will($this->returnValue('url')); $this->service->setBusinessAccount($businessAccount); $method = new \ReflectionMethod($this->service, 'signUrl'); $method->setAccessible(true); $this->assertSame('url', $method->invoke($this->service, $url)); }
/** * Creates a directions service. * * @param \Widop\HttpAdapter\HttpAdapterInterface $httpAdapter The http adapter. */ public function __construct(HttpAdapterInterface $httpAdapter) { parent::__construct($httpAdapter, 'http://maps.googleapis.com/maps/api/directions'); }