From 56cb8ab381ac4a37e7654c0a9b3a182559cf4fb8 Mon Sep 17 00:00:00 2001 From: Doug Wright Date: Mon, 6 May 2024 18:44:44 +0100 Subject: [PATCH] Update testcase for #608 --- tests/PackerTest.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/PackerTest.php b/tests/PackerTest.php index 64bdeb6..11cc7e5 100644 --- a/tests/PackerTest.php +++ b/tests/PackerTest.php @@ -1234,18 +1234,18 @@ public function testIssue608Default(): void $w += 10; } - $packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::BestFit), 1); + $packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::KeepFlat), 1); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack()); self::assertCount(2, $packedBoxes); - self::assertEquals('Box120 2060', $packedBoxes[0]->box->getReference()); + self::assertEquals('Box250 1180', $packedBoxes[0]->box->getReference()); self::assertEquals('Box250 2260', $packedBoxes[1]->box->getReference()); } @@ -1261,19 +1261,19 @@ public function testIssue608NoWeightRedistribution(): void $w += 10; } - $packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::BestFit), 1); - $packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::BestFit), 1); + $packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::KeepFlat), 1); + $packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::KeepFlat), 1); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack()); self::assertCount(2, $packedBoxes); - self::assertEquals('Box250 2260', $packedBoxes[0]->box->getReference()); - self::assertEquals('Box120 400', $packedBoxes[1]->box->getReference()); + self::assertEquals('Box250 2320', $packedBoxes[0]->box->getReference()); + self::assertEquals('Box120 1590', $packedBoxes[1]->box->getReference()); } public function testCustomPackedBoxSorterIsUsed(): void