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