/** * @covers OAuth\Common\Service\AbstractService::__construct * @covers OAuth\Common\Service\AbstractService::determineRequestUriFromPath */ public function testDetermineRequestUriFromPathWithLeadingSlashInPath() { $service = new Mock($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), ServiceFactory::construct()->getHttpTransporter(), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface'), 'https://example.com'); $uri = $service->testDetermineRequestUriFromPath('/path'); $this->assertInstanceOf('\\OAuth\\Common\\Http\\Url', $uri); $this->assertSame('https://example.com/path', (string) $uri); }
/** * @covers OAuth\ServiceFactory::createService * @covers OAuth\ServiceFactory::getFullyQualifiedServiceName * @covers OAuth\ServiceFactory::buildV1Service */ public function testCreateServiceOAuth1NonRegistered() { $service = ServiceFactory::construct()->createService('twitter', $this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface')); $this->assertInstanceOf('\\OAuth\\OAuth1\\Service\\Twitter', $service); }