/** * @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\Common\Service\AbstractService::__construct * @covers OAuth\Common\Service\AbstractService::determineRequestUriFromPath */ public function testDetermineRequestUriFromPathWithLeadingSlashInPath() { $service = new Mock($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface')); $uri = $service->testDetermineRequestUriFromPath('/path', new \OAuth\Common\Http\Uri\Uri('https://example.com')); $this->assertInstanceOf('\\OAuth\\Common\\Http\\Uri\\UriInterface', $uri); $this->assertSame('https://example.com/path', $uri->getAbsoluteUri()); }