/** * @covers OAuth\OAuth1\Service\Twitter::__construct * @covers OAuth\OAuth1\Service\Twitter::getAuthorizationEndpoint */ public function testGetAuthorizationEndpoint() { $service = new Twitter($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\Buzz\\Browser'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface'), $this->getMock('\\OAuth\\OAuth1\\Signature\\SignatureInterface')); $this->assertTrue(in_array(strtolower((string) $service->getAuthorizationEndpoint()), [\OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHENTICATE, \OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHORIZE])); $service->setAuthorizationEndpoint(\OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHORIZE); $this->assertTrue(in_array(strtolower((string) $service->getAuthorizationEndpoint()), [\OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHENTICATE, \OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHORIZE])); }
/** * @covers OAuth\OAuth1\Service\Twitter::__construct * @covers OAuth\OAuth1\Service\Twitter::getAuthorizationEndpoint */ public function testGetAuthorizationEndpoint() { $service = new Twitter($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface'), $this->getMock('\\OAuth\\OAuth1\\Signature\\SignatureInterface')); $this->assertTrue(in_array(strtolower($service->getAuthorizationEndpoint()->getAbsoluteUri()), array(\OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHENTICATE, \OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHORIZE))); $service->setAuthorizationEndpoint(\OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHORIZE); $this->assertTrue(in_array(strtolower($service->getAuthorizationEndpoint()->getAbsoluteUri()), array(\OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHENTICATE, \OAuth\OAuth1\Service\Twitter::ENDPOINT_AUTHORIZE))); }