Example #1
0
 public function testCanFareInformativePricingWithoutPnrVersion14()
 {
     $mockSessionHandler = $this->getMockBuilder('Amadeus\\Client\\Session\\Handler\\HandlerInterface')->getMock();
     $mockedSendResult = new Client\Session\Handler\SendResult();
     $mockedSendResult->responseXml = $this->getTestFile('fareInformativePricingWithoutPnrReply14.txt');
     $messageResult = new Client\Result($mockedSendResult);
     $expectedMessageResult = new Client\Struct\Fare\InformativePricingWithoutPNR13(new Client\RequestOptions\FareInformativePricingWithoutPnrOptions([]));
     $mockSessionHandler->expects($this->once())->method('sendMessage')->with('Fare_InformativePricingWithoutPNR', $expectedMessageResult, ['endSession' => false])->will($this->returnValue($mockedSendResult));
     $mockSessionHandler->expects($this->never())->method('getLastResponse');
     $mockSessionHandler->expects($this->once())->method('getMessagesAndVersions')->will($this->returnValue(['Fare_InformativePricingWithoutPNR' => "15.1"]));
     $par = new Params();
     $par->sessionHandler = $mockSessionHandler;
     $par->requestCreatorParams = new Params\RequestCreatorParams(['receivedFrom' => 'some RF string', 'originatorOfficeId' => 'BRUXXXXXX']);
     $client = new Client($par);
     $response = $client->fareInformativePricingWithoutPnr(new Client\RequestOptions\FareInformativePricingWithoutPnrOptions([]));
     $this->assertEquals($messageResult, $response);
 }