-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for detecting errors in PNR_RetrieveAndDisplay messages (#2) …
…+ Code coverage improvements
- Loading branch information
Showing
14 changed files
with
466 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\RequestOptions\Pnr\Segment; | ||
|
||
use Amadeus\Client\RequestOptions\Pnr\Segment; | ||
|
||
/** | ||
* Hotel | ||
* | ||
* @package Amadeus\Client\RequestOptions\Pnr\Segment | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class Hotel extends Segment | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/Amadeus/Client/ResponseHandler/testfiles/dummyPnrRetrieveAndDisplayErr2Response.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<PNR_RetrieveAndDisplayReply xmlns="http://xml.amadeus.com/PADSRR_12_2_1A"> | ||
<errorDetails> | ||
<errorOrWarningCodeDetails> | ||
<errorDetails> | ||
<errorCode>27563</errorCode> | ||
</errorDetails> | ||
</errorOrWarningCodeDetails> | ||
<errorWarningDescription> | ||
<freeTextDetails> | ||
<textSubjectQualifier>1</textSubjectQualifier> | ||
<source>M</source> | ||
<encoding>1</encoding> | ||
</freeTextDetails> | ||
<freeText>NO OFFER</freeText> | ||
</errorWarningDescription> | ||
</errorDetails> | ||
</PNR_RetrieveAndDisplayReply> |
1 change: 1 addition & 0 deletions
1
tests/Amadeus/Client/ResponseHandler/testfiles/dummyPnrRetrieveAndDisplayErrResponse.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<PNR_RetrieveAndDisplayReply xmlns="http://xml.amadeus.com/PADSRR_12_2_1A"><errorDetails><errorOrWarningCodeDetails><errorDetails><errorCode>1</errorCode></errorDetails></errorOrWarningCodeDetails><errorWarningDescription><freeTextDetails><textSubjectQualifier>1</textSubjectQualifier><source>M</source><encoding>1</encoding></freeTextDetails><freeText>NO MATCH FOR RECORD LOCATOR</freeText></errorWarningDescription></errorDetails></PNR_RetrieveAndDisplayReply> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
tests/Amadeus/Client/Struct/Offer/ConfirmHotel/AgeTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Test\Amadeus\Client\Struct\Offer\ConfirmHotel; | ||
|
||
use Amadeus\Client\Struct\Offer\ConfirmHotel\Age; | ||
use Amadeus\Client\Struct\Offer\ConfirmHotel\QuantityDetails; | ||
use Test\Amadeus\BaseTestCase; | ||
|
||
/** | ||
* AgeTest | ||
* | ||
* @package Test\Amadeus\Client\Struct\Offer\ConfirmHotel | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class AgeTest extends BaseTestCase | ||
{ | ||
public function testCanCreate() | ||
{ | ||
$age = new Age('25'); | ||
|
||
$this->assertEquals('25', $age->quantityDetails->value); | ||
$this->assertEquals(QuantityDetails::QUAL_AGE, $age->quantityDetails->qualifier); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
tests/Amadeus/Client/Struct/Offer/ConfirmHotel/HotelProductReferenceTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Test\Amadeus\Client\Struct\Offer\ConfirmHotel; | ||
|
||
use Amadeus\Client\Struct\Offer\ConfirmHotel\HotelProductReference; | ||
use Amadeus\Client\Struct\Offer\ConfirmHotel\ReferenceDetails; | ||
use Test\Amadeus\BaseTestCase; | ||
|
||
/** | ||
* HotelProductReferenceTest | ||
* | ||
* @package Test\Amadeus\Client\Struct\Offer\ConfirmHotel | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class HotelProductReferenceTest extends BaseTestCase | ||
{ | ||
public function testCanCreate() | ||
{ | ||
$element = new HotelProductReference(); | ||
|
||
$this->assertEquals(ReferenceDetails::TYPE_BOOKING_CODE, $element->referenceDetails->type); | ||
$this->assertNull($element->referenceDetails->value); | ||
} | ||
} |
Oops, something went wrong.