/** * @group tenant * @depends testTenants */ public function testRescopeUsingTenantId() { $service = new IdentityService(self::conf('openstack.identity.url'), $this->getTransportClient()); $user = self::conf('openstack.identity.username'); $pass = self::conf('openstack.identity.password'); $tenantId = self::conf('openstack.identity.tenantId'); // Authenticate without a tenant ID. $token = $service->authenticateAsUser($user, $pass); $this->assertNotEmpty($token); $details = $service->tokenDetails(); $this->assertFalse(isset($details['tenant'])); $service->rescopeUsingTenantId($tenantId); $details = $service->tokenDetails(); $this->assertEquals($tenantId, $details['tenant']['id']); // Test unscoping $service->rescopeUsingTenantId(''); $details = $service->tokenDetails(); $this->assertFalse(isset($details['tenant'])); }