/** * Tests Zend\Service\Amazon\Ec2\Ebs->detachVolume() */ public function testDetachVolume() { $rawHttpResponse = "HTTP/1.1 200 OK\r\n" . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" . "Server: hi\r\n" . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" . "Status: 200 OK\r\n" . "Content-type: application/xml; charset=utf-8\r\n" . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" . "Connection: close\r\n" . "\r\n" . "<DetachVolumeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" . " <volumeId>vol-4d826724</volumeId>\r\n" . " <instanceId>i-6058a509</instanceId>\r\n" . " <device>/dev/sdh</device>\r\n" . " <status>detaching</status>\r\n" . " <attachTime>2008-05-08T11:51:50.000Z</attachTime>\r\n" . "</DetachVolumeResponse>"; $this->httpClientTestAdapter->setResponse($rawHttpResponse); $return = $this->ebsInstance->detachVolume('vol-4d826724'); $arrVolume = array('volumeId' => 'vol-4d826724', 'instanceId' => 'i-6058a509', 'device' => '/dev/sdh', 'status' => 'detaching', 'attachTime' => '2008-05-08T11:51:50.000Z'); $this->assertSame($arrVolume, $return); }
/** * Prepares the environment before running a test. */ protected function setUp() { parent::setUp(); $this->ebsInstance = new Ec2\Ebs('access_key', 'secret_access_key'); $adapter = new \Zend\Http\Client\Adapter\Test(); $client = new \Zend\Http\Client(null, array('adapter' => $adapter)); $this->adapter = $adapter; Ec2\Ebs::setDefaultHTTPClient($client); }
/** * Prepares the environment before running a test. */ protected function setUp() { parent::setUp(); $this->Zend_Service_Amazon_Ec2_Ebs = new Ec2\Ebs('access_key', 'secret_access_key'); $adapter = new \Zend\HTTP\Client\Adapter\Test(); $client = new \Zend\HTTP\Client(null, array('adapter' => $adapter)); $this->adapter = $adapter; Ec2\Ebs::setDefaultHTTPClient($client); }