/** * Tests */ public function test__construct() { $conn = new StubConnection('http://example.com', 'SECRET'); $compute = $conn->Compute(NULL, 'DFW'); $this->att = new publicVolumeAttachment(new \OpenCloud\Compute\Server($compute, 'XXX'), 'FOO'); $this->assertEquals('FOO', $this->att->volumeId); }
public function testImportCredentials() { $this->my->Authenticate(); $arr = $this->my->ExportCredentials(); $conn = new StubConnection(TEST_DOMAIN, array('username' => 'Foo', 'password' => 'Bar')); $conn->ImportCredentials($arr); $this->assertEquals($arr['token'], $conn->Token()); }