/** * Sets up this test case * * @return void */ public function setUp() { $this->gogrid = new Server('foo', 'bar'); $this->httpClientAdapterTest = new \Zend\Http\Client\Adapter\Test(); $this->gogrid->getHttpClient()->setAdapter($this->httpClientAdapterTest); $filename = __DIR__ . '/_files/' . $this->getName() . '.response'; if (file_exists($filename)) { $this->httpClientAdapterTest->setResponse($this->loadResponse($filename)); } }
/** * testJobList * * @return void */ public function testJobList() { $this->_job->getHttpClient()->setAdapter($this->_httpClientAdapterTest); $this->_httpClientAdapterTest->setResponse($this->_loadResponse(__FUNCTION__)); $joblist = $this->_job->getList(); $this->assertEquals(count($joblist), 2); $this->assertEquals($joblist->getStatus(), 'success'); $job = $joblist[0]; $this->assertEquals($job->getAttribute('id'), '583288'); $this->assertEquals($job->getAttribute('owner'), '*****@*****.**'); $command = $job->getAttribute('command'); $this->assertEquals($command['name'], 'DeleteVirtualServer'); $history = $job->getAttribute('history'); $this->assertEquals($history[0]['id'], '3303238'); $this->assertEquals(count($history), 4); }