예제 #1
0
 public function __construct(Parcel $parcel)
 {
     $this->entity = $parcel;
     $this->entityDTO = new ParcelDTO();
     $this->setTime();
     $this->entityDTO->externalId = $this->entity->getExternalId();
     $this->entityDTO->length = $this->entity->getLength();
     $this->entityDTO->width = $this->entity->getWidth();
     $this->entityDTO->height = $this->entity->getHeight();
     $this->entityDTO->weight = $this->entity->getWeight();
     $this->entityDTO->predefinedPackage = $this->entity->getPredefinedPackage();
 }
예제 #2
0
 public function getParcelSmallFlatRateBox()
 {
     $parcel = new Parcel();
     $parcel->setExternalId('prcl_xxxx');
     $parcel->setPredefinedPackage('SmallFlatRateBox');
     $parcel->setWeight(32);
     return $parcel;
 }
예제 #3
0
 public function testCreate()
 {
     $parcel = new Parcel();
     $parcel->setExternalId('prcl_xxxxx');
     $parcel->setLength(8.0);
     $parcel->setWidth(6.0);
     $parcel->setHeight(4.0);
     $parcel->setWeight(32);
     $parcel->setPredefinedPackage('SmallFlatRateBox');
     $this->assertSame('prcl_xxxxx', $parcel->getExternalId());
     $this->assertSame('SmallFlatRateBox', $parcel->getPredefinedPackage());
     $this->assertSame(8.0, $parcel->getLength());
     $this->assertSame(6.0, $parcel->getWidth());
     $this->assertSame(4.0, $parcel->getHeight());
     $this->assertSame(32, $parcel->getWeight());
 }