#4 make sure object storage newFromIdentity worked for multiple regions.
This commit is contained in:
parent
fae05946a6
commit
921c531a29
@ -181,7 +181,7 @@ class ObjectStorage {
|
||||
public static function newFromIdentity($identity, $region = ObjectStorage::DEFAULT_REGION) {
|
||||
$cat = $identity->serviceCatalog();
|
||||
$tok = $identity->token();
|
||||
return self::newFromServiceCatalog($cat, $tok);
|
||||
return self::newFromServiceCatalog($cat, $tok, $region);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,6 +100,17 @@ class ObjectStorageTest extends \HPCloud\Tests\TestCase {
|
||||
$this->assertTrue(strlen($ostore->token()) > 0);
|
||||
}
|
||||
|
||||
public function testNewFromIdentityAltRegion() {
|
||||
$ident = $this->identity();
|
||||
$ostore = \HPCloud\Storage\ObjectStorage::newFromIdentity($ident, 'region-b.geo-1');
|
||||
$this->assertInstanceOf('\HPCloud\Storage\ObjectStorage', $ostore);
|
||||
$this->assertTrue(strlen($ostore->token()) > 0);
|
||||
|
||||
// Make sure the store is not the same as the default region.
|
||||
$ostoreDefault = \HPCloud\Storage\ObjectStorage::newFromIdentity($ident);
|
||||
$this->assertNotEquals($ostore, $ostoreDefault);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group auth
|
||||
* @ group acl
|
||||
|
Loading…
x
Reference in New Issue
Block a user