public function testCanFarePricePnrWithLowestFareVersion12() { $mockSessionHandler = $this->getMockBuilder('Amadeus\\Client\\Session\\Handler\\HandlerInterface')->getMock(); $mockedSendResult = new Client\Session\Handler\SendResult(); $mockedSendResult->responseXml = 'dummyfarepricepnrwithlowestfarev12message'; $messageResult = new Client\Result($mockedSendResult); $expectedMessageResult = new Client\Struct\Fare\PricePNRWithLowestFare12(new Client\RequestOptions\FarePricePnrWithLowestFareOptions(['validatingCarrier' => 'SN'])); $mockSessionHandler->expects($this->once())->method('sendMessage')->with('Fare_PricePNRWithLowestFare', $expectedMessageResult, ['endSession' => false])->will($this->returnValue($mockedSendResult)); $mockSessionHandler->expects($this->never())->method('getLastResponse'); $mockSessionHandler->expects($this->once())->method('getMessagesAndVersions')->will($this->returnValue(['Fare_PricePNRWithLowestFare' => "12.4"])); $mockResponseHandler = $this->getMockBuilder('Amadeus\\Client\\ResponseHandler\\ResponseHandlerInterface')->getMock(); $mockResponseHandler->expects($this->once())->method('analyzeResponse')->with($mockedSendResult, 'Fare_PricePNRWithLowestFare')->will($this->returnValue($messageResult)); $par = new Params(); $par->sessionHandler = $mockSessionHandler; $par->requestCreatorParams = new Params\RequestCreatorParams(['receivedFrom' => 'some RF string', 'originatorOfficeId' => 'BRUXXXXXX']); $par->responseHandler = $mockResponseHandler; $client = new Client($par); $response = $client->farePricePnrWithLowestFare(new Client\RequestOptions\FarePricePnrWithLowestFareOptions(['validatingCarrier' => 'SN'])); $this->assertEquals($messageResult, $response); }