Exemplo n.º 1
0
 /**
  * @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);
 }
Exemplo n.º 2
0
 /**
  * @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);
 }