/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->tenant = new Tenant('http://example.org', 'user', 'p@$$', 'compute');
     $this->token = new Token('abcd1234', new \DateTime('+1 hour'));
     $this->token->addServiceCatalog('compute', 'api', [['publicurl' => $this->endpointUrl]]);
     $this->cache = $this->getMockBuilder(CacheInterface::class)->disableOriginalConstructor()->setMethods(['get', 'set'])->getMockForAbstractClass();
     $this->pool = $this->getMockBuilder(TokenPool::class)->setConstructorArgs([$this->tenant, $this->cache])->setMethods(['requestToken'])->getMock();
 }
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     $url = 'http://example.org';
     $user = '******';
     $pass = '******';
     $serviceType = 'object-store';
     $serviceName = 'cdn';
     $this->tenant = new Tenant($url, $user, $pass, $serviceType, $serviceName);
     $this->token = new Token(uniqid(), new \DateTime('+1 hour'));
     $this->token->addServiceCatalog($serviceType, $serviceName, [['publicUrl' => 'http://example.org/v1']]);
 }
Exemplo n.º 3
0
 /**
  * @test
  * @expectedException \TreeHouse\Keystone\Client\Exception\TokenException
  */
 public function it_throws_exception_on_undefined_service_catalog_name()
 {
     $token = new Token(uniqid(), new \DateTime('+ 1 minute'));
     $token->addServiceCatalog('compute', 'test', [['adminurl' => 'https://admin.example.org', 'publicurl' => 'https://example.org']]);
     $token->getServiceCatalog('compute', 'api');
 }