/** * @covers OAuth\OAuth2\Service\Google::__construct * @covers OAuth\OAuth2\Service\Google::getAuthorizationEndpoint */ public function testGetAuthorizationEndpoint() { $service = new Google($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface')); $this->assertSame('https://accounts.google.com/o/oauth2/auth?access_type=online', $service->getAuthorizationEndpoint()->getAbsoluteUri()); // Verify that 'offine' works $service->setAccessType('offline'); $this->assertSame('https://accounts.google.com/o/oauth2/auth?access_type=offline', $service->getAuthorizationEndpoint()->getAbsoluteUri()); }
/** * @covers OAuth\OAuth2\Service\Google::__construct * @covers OAuth\OAuth2\Service\Google::getAuthorizationEndpoint */ public function testGetAuthorizationEndpoint() { $service = new Google($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface')); $this->assertSame('https://accounts.google.com/o/oauth2/auth', $service->getAuthorizationEndpoint()->getAbsoluteUri()); }