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(); }
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()); }