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
 /**
  * @param Model $Model
  *
  * @depends testCreate
  */
 public function testGet(Model $Model)
 {
     $this->mockResponse(200, $this->getMockData());
     $API = new API();
     $Model = $API->get($Model->getUuid());
     $this->assertInstanceOf(Model::class, $Model);
 }