Skip to content

Commit

Permalink
Testing Criterion loading with AlternateAvailability
Browse files Browse the repository at this point in the history
  • Loading branch information
DerMika committed Apr 26, 2017
1 parent 3819ec7 commit 8071096
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Criteria extends LoadParamsFromArray
{
const ALT_AVAIL_NEVER = "Never";

/**
* @var bool
*/
Expand Down Expand Up @@ -61,4 +63,11 @@ class Criteria extends LoadParamsFromArray
* @var Room[]
*/
public $rooms = [];

/**
* self::ALT_AVAIL_*
*
* @var string
*/
public $alternateAvailability;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ class Criterion extends HotelSearchCriterionType
*/
public $AlternateAvailability;

/**
* @var RateRange[]
*/
public $RateRange = [];

/**
* Criterion constructor.
*
Expand All @@ -63,5 +68,7 @@ public function __construct(Criteria $criterion)
$this->RoomStayCandidates->RoomStayCandidate[] = new RoomStayCandidate($room);
}
}

$this->AlternateAvailability = $criterion->alternateAvailability;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ class HotelSearchCriterionType extends ItemSearchCriterionType
*/
public $StayDateRange;

/**
* @var RateRange[]
*/
public $RateRange = [];

/**
* @var RatePlanCandidates
Expand Down
2 changes: 2 additions & 0 deletions tests/Amadeus/Client/ResponseHandler/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ public function testCanHandleHotelMultiSingleAvailabilityErr()
$sendResult->responseXml = $this->getTestFile('dummyHotelMultiSingleAvailabilityErrorResponse.txt');
$sendResult->messageVersion = '10.0';

$this->markTestIncomplete('Still need a proper example of an error response');

$result = $respHandler->analyzeResponse($sendResult, 'Hotel_MultiSingleAvailability');

$this->assertEquals(Result::STATUS_ERROR, $result->status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public function testCanMakeMessage()
$this->assertCount(1, $msg->AvailRequestSegments->AvailRequestSegment);
$this->assertEquals('Distribution', $msg->AvailRequestSegments->AvailRequestSegment[0]->InfoSource);

//TODO other asserts
$this->assertCount(1, $msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion);
$this->assertTrue($msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion[0]->ExactMatch);
$this->assertCount(1, $msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion[0]->HotelRef);
$this->assertEquals('RT', $msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion[0]->HotelRef[0]->ChainCode);
}
}

0 comments on commit 8071096

Please sign in to comment.