-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing PNR_Ignore Call and corresponding tests
- Loading branch information
Showing
9 changed files
with
341 additions
and
1 deletion.
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
47 changes: 47 additions & 0 deletions
47
src/Amadeus/Client/RequestCreator/Converter/PNR/IgnoreConv.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,47 @@ | ||
<?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\RequestCreator\Converter\PNR; | ||
|
||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\PnrIgnoreOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
/** | ||
* PNR_Ignore Request converter | ||
* | ||
* @package Amadeus\Client\RequestCreator\Converter\PNR | ||
* @author Michael Mueller <michael.mueller@invia.de> | ||
*/ | ||
class IgnoreConv extends BaseConverter | ||
{ | ||
/** | ||
* @param PnrIgnoreOptions $requestOptions | ||
* @param int|string $version | ||
* | ||
* @return Struct\Pnr\Ignore | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Pnr\Ignore($requestOptions); | ||
} | ||
} |
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,39 @@ | ||
<?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_Cancel Request Options | ||
* | ||
* @package Amadeus\Client\RequestOptions | ||
* @author Michael Mueller <michael.mueller@invia.de> | ||
*/ | ||
class PnrIgnoreOptions extends PnrBase | ||
{ | ||
/** | ||
* The Action Request used, should be "A" or ClearInformation::CODE_IGNORE | ||
* | ||
* @var string | ||
*/ | ||
public $actionRequest; | ||
} |
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,33 @@ | ||
<?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\ResponseHandler\PNR; | ||
|
||
/** | ||
* HandlerIgnore | ||
* | ||
* @package Amadeus\Client\ResponseHandler\PNR | ||
* @author Michael Mueller <michael.mueller@invia.de> | ||
*/ | ||
class HandlerIgnore extends HandlerRetrieve | ||
{ | ||
} |
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,59 @@ | ||
<?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\Struct\Pnr; | ||
|
||
use Amadeus\Client\RequestOptions\PnrIgnoreOptions; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
use Amadeus\Client\Struct\Pnr\Ignore\ClearInformation; | ||
|
||
/** | ||
* PNR_Ignore message structure | ||
* | ||
* @package Amadeus\Client\Struct\Pnr | ||
* @author Michael Mueller <michael.mueller@invia.de> | ||
*/ | ||
class Ignore extends BaseWsMessage | ||
{ | ||
/** | ||
* @var ClearInformation | ||
*/ | ||
public $clearInformation; | ||
|
||
/** | ||
* Ignore constructor. | ||
* | ||
* @param PnrIgnoreOptions $options | ||
*/ | ||
public function __construct(PnrIgnoreOptions $options) | ||
{ | ||
$this->loadClearInformation($options->actionRequest); | ||
} | ||
|
||
/** | ||
* @param $actionRequestCode | ||
*/ | ||
public function loadClearInformation($actionRequestCode) | ||
{ | ||
$this->clearInformation = new ClearInformation($actionRequestCode); | ||
} | ||
} |
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,51 @@ | ||
<?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\Struct\Pnr\Ignore; | ||
|
||
use Amadeus\Client\Struct\BaseWsMessage; | ||
|
||
/** | ||
* PNR_Ignore message structure | ||
* | ||
* @package Amadeus\Client\Struct\Pnr | ||
* @author Michael Mueller <michael.mueller@invia.de> | ||
*/ | ||
class ClearInformation extends BaseWsMessage | ||
{ | ||
const CODE_IGNORE = "A"; | ||
|
||
/** | ||
* @var self::CODE_* | ||
*/ | ||
public $actionRequestCode; | ||
|
||
/** | ||
* Ignore constructor. | ||
* | ||
* @param string $actionRequestCode self::CODE_* | ||
*/ | ||
public function __construct($actionRequestCode) | ||
{ | ||
$this->actionRequestCode = $actionRequestCode; | ||
} | ||
} |
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,46 @@ | ||
<?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\Pnr; | ||
|
||
use Amadeus\Client\RequestOptions\PnrIgnoreOptions; | ||
use Test\Amadeus\BaseTestCase; | ||
use Amadeus\Client\Struct\Pnr\Ignore; | ||
|
||
/** | ||
* IgnoreTest | ||
* | ||
* @package Test\Amadeus\Client\Struct\Pnr | ||
*/ | ||
class IgnoreTest extends BaseTestCase | ||
{ | ||
public function testCanMakeIgnoreMessage() | ||
{ | ||
$options = new PnrIgnoreOptions(); | ||
$options->actionRequest = Ignore\ClearInformation::CODE_IGNORE; | ||
$message = new Ignore( | ||
$options | ||
); | ||
$this->assertInstanceOf('Amadeus\Client\Struct\Pnr\Ignore\ClearInformation', $message->clearInformation); | ||
$this->assertEquals(Ignore\ClearInformation::CODE_IGNORE, $message->clearInformation->actionRequestCode); | ||
} | ||
} |
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