From b919962bbd7a37b6a06763c04377ab6adbd43c29 Mon Sep 17 00:00:00 2001 From: Doug Wright Date: Sun, 5 Feb 2023 16:32:01 +0000 Subject: [PATCH] Add testcase for #264 --- tests/VolumePackerTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/VolumePackerTest.php b/tests/VolumePackerTest.php index 566da0e3..93410304 100644 --- a/tests/VolumePackerTest.php +++ b/tests/VolumePackerTest.php @@ -513,4 +513,24 @@ public function testIssue240(): void self::assertCount(18, $packedBox->getItems()); } + + public function testIssue264(): void + { + foreach ([Rotation::KeepFlat, Rotation::BestFit] as $rotation) { + $this->markTestSkipped(); + $box = new TestBox('Small', 160, 130, 70, 0, 160, 130, 70, 100000); + + $items = new ItemList(); + $items->insert(new TestItem('Item 1', 105, 70, 14, 0, $rotation), 1); + $items->insert(new TestItem('Item 2', 152, 101, 5, 0, $rotation), 1); + $items->insert(new TestItem('Item 3', 80, 70, 50, 0, $rotation), 1); + $items->insert(new TestItem('Item 4', 97, 71, 28, 0, $rotation), 1); + $items->insert(new TestItem('Item 5', 95, 70, 28, 0, $rotation), 1); + + $volumePacker = new VolumePacker($box, $items); + $packedBox = $volumePacker->pack(); + + self::assertCount(5, $packedBox->getItems()); + } + } }