public function testWaitForStateTimeOut()
 {
     $Facker = Factory::create();
     $MockedModel = new Model(json_decode(ServiceTest::getMockData(), true));
     $this->mockResponses([new Response(200, ['Content-Type' => 'application/json'], Encoder::encode($MockedModel->setState(Model::STATE_NOT_RUNNING)->getArrayCopy())), new Response(200, ['Content-Type' => 'application/json'], Encoder::encode($MockedModel->setState(Model::STATE_STARTING)->getArrayCopy()))]);
     $API = new API();
     $Model = $API->get($Facker->uuid);
     $this->expectException(Exception::class);
     $this->expectExceptionMessageRegExp('/.*timed out.*/');
     $API->waitForState($Model, Model::STATE_RUNNING, 0.1, 0);
 }
Пример #2
0
 public function testGetListByUri()
 {
     $this->mockGetListResponse(200, $this->getMockData());
     $API = new API();
     $this->assertInstanceOf(ServiceGetListResponse::class, $API->getListByUri('mock_uri'));
 }