/** * @param PackageDetails $packageDetails */ public function __construct(PackageDetails $packageDetails) { $this->width = $packageDetails->getWidth(); $this->height = $packageDetails->getHeight(); $this->depth = $packageDetails->getDepth(); $this->weight = $packageDetails->getWeight(); $this->maxWeight = $packageDetails->getMaxWeight(); }
public function testConstruct() { $packageDetails = new PackageDetails(123, 456, 789, 321, 654); $this->assertSame(123, $packageDetails->getWidth()); $this->assertSame(456, $packageDetails->getHeight()); $this->assertSame(789, $packageDetails->getDepth()); $this->assertSame(321, $packageDetails->getWeight()); $this->assertSame(654, $packageDetails->getMaxWeight()); }