コード例 #1
0
 /**
  * @author nathanhelenihi
  * @group api
  * @dataProvider fixtureAuthCfgObject
  */
 public function testCallApi(array $fxt)
 {
     if (!$fxt['from_env']) {
         $this->markTestSkipped('Environment credentials not set.');
     }
     $obj = new RoomImageRemove($fxt);
     $obj->setConfig('dataFormat', 'array');
     if (!$obj->isEnabled()) {
         $this->markTestSkipped('API is disabled!');
     }
     // Valid order id and valid password should succeed
     $rsp = $obj->callApiWithParams(array('RoomImage' => array('RoomImageId' => 3221)));
     $this->assertTrue(isset($rsp['response']['body']['Payments']));
 }
コード例 #2
0
 /**
  * @author nathanhelenihi
  * @group api
  * @dataProvider fixtureAuthCfgObject
  */
 public function testCallApi(array $fxt)
 {
     if (!$fxt['from_env']) {
         $this->markTestSkipped('Environment credentials not set.');
     }
     $obj = new RoomImageRemove($fxt);
     $obj->setConfig('dataFormat', 'xml');
     if (!$obj->isEnabled()) {
         $this->markTestSkipped('API is disabled!');
     }
     // Invalid booking id should fail
     $auth = $fxt['auth'];
     $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n                <RoomImageRemove>\n                    <Auth>\n                        <VendorId>{$auth->vendorId}</VendorId>\n                        <VendorPassword>{$auth->vendorPassword}</VendorPassword>\n                        <UserId>{$auth->userId}</UserId>\n                        <UserPassword>{$auth->userPassword}</UserPassword>\n                        <PropertyId>{$auth->propertyId}</PropertyId>\n                    </Auth>\n                    <RemoveRoomImages>\n                        <RoomImageIds>\n                            <RoomImageId>3221</RoomImageId>\n                        </RoomImageIds>\n                    </RemoveRoomImages>\n                </RoomImageRemove>\n        ";
     $rsp = $obj->callApiWithParams($xml);
     $this->assertEquals(200, $rsp['response']['code']);
     $this->assertFalse(strpos($rsp['response']['body'], '<Errors>'), 'Response contains errors!');
 }