예제 #1
0
 public function testRequest()
 {
     $tit = new Ups\TimeInTransit();
     $tit->setRequest($request = new RequestMock(null, '/TimeInTransit/Response1.xml'));
     $times = $tit->getTimeInTransit(new Ups\Entity\TimeInTransitRequest());
     // Test response
     $this->assertInstanceOf('\\Ups\\Entity\\TimeInTransitResponse', $times);
     $this->assertInstanceOf('\\Ups\\Entity\\AddressArtifactFormat', $times->TransitFrom);
     $this->assertInstanceOf('\\Ups\\Entity\\AddressArtifactFormat', $times->TransitTo);
     $this->assertInstanceOf('\\Ups\\Entity\\ShipmentWeight', $times->ShipmentWeight);
     $this->assertInstanceOf('\\Ups\\Entity\\Charges', $times->InvoiceLineTotal);
     $this->assertInstanceOf('\\Ups\\Entity\\ServiceSummary', $times->ServiceSummary[0]);
     $this->assertInternalType('string', $times->Disclaimer);
     $this->assertObjectHasAttribute('PickupDate', $times);
     $this->assertObjectHasAttribute('MaximumListSize', $times);
     $this->assertObjectHasAttribute('ServiceSummary', $times);
     $this->assertAttributeCount(3, 'ServiceSummary', $times);
 }
예제 #2
0
 /**
  * @param ResponseInterface $response
  *
  * @return $this
  */
 public function setResponse(ResponseInterface $response)
 {
     $this->upsTimeInTransit->setResponse($response);
     return $this;
 }