Exemple #1
0
 public function testCanCreateQueueListMessage()
 {
     $par = new RequestCreatorParams(['originatorOfficeId' => 'BRUXXXXXX', 'receivedFrom' => 'some RF string']);
     $rq = new Base($par);
     $message = $rq->createRequest('queueList', new QueueListOptions(['queue' => new Queue(['queue' => 50, 'category' => 1])]));
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\QueueList', $message);
     /** @var QueueList $message */
     $this->assertNull($message->date);
     $this->assertNull($message->scanRange);
     $this->assertNull($message->scroll);
     $this->assertEmpty($message->searchCriteria);
     $this->assertNull($message->targetOffice);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\QueueNumber', $message->queueNumber);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\QueueDetails', $message->queueNumber->queueDetails);
     $this->assertEquals(50, $message->queueNumber->queueDetails->number);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\CategoryDetails', $message->categoryDetails);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\SubQueueInfoDetails', $message->categoryDetails->subQueueInfoDetails);
     $this->assertEquals(1, $message->categoryDetails->subQueueInfoDetails->itemNumber);
     $this->assertEquals(SubQueueInfoDetails::IDTYPE_CATEGORY, $message->categoryDetails->subQueueInfoDetails->identificationType);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\SortCriteria', $message->sortCriteria);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\Dumbo', $message->sortCriteria->dumbo);
     $this->assertInternalType('array', $message->sortCriteria->sortOption);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\SortOption', $message->sortCriteria->sortOption[0]);
     $this->assertInstanceOf('Amadeus\\Client\\Struct\\Queue\\SelectionDetails', $message->sortCriteria->sortOption[0]->selectionDetails);
     $this->assertEquals(SelectionDetails::LIST_OPTION_SORT_CREATION, $message->sortCriteria->sortOption[0]->selectionDetails->option);
 }
 public function testCanTryBuildingSameMessageTwiceWillReuseBuilder()
 {
     $par = new RequestCreatorParams(['originatorOfficeId' => 'BRUXXXXXX', 'receivedFrom' => 'some RF string', 'messagesAndVersions' => ['Fare_InformativeBestPricingWithoutPNR' => '14.1']]);
     $rq = new Base($par);
     $rq->createRequest('Fare_InformativeBestPricingWithoutPNR', new FareInformativeBestPricingWithoutPnrOptions([]));
     $rq->createRequest('Fare_InformativeBestPricingWithoutPNR', new FareInformativeBestPricingWithoutPnrOptions(['pricingOptions' => new PricingOptions(['overrideOptions' => [PricingOptions::OVERRIDE_FARETYPE_PUB, PricingOptions::OVERRIDE_FARETYPE_NEG, PricingOptions::OVERRIDE_FARETYPE_UNI]])]));
 }