From 0f8c07abb2aa3b3db322ac68f9e31c5aeec09619 Mon Sep 17 00:00:00 2001 From: IBBoard Date: Sun, 25 Oct 2015 17:58:14 +0000 Subject: [PATCH] Fix expected result for failing test Expected boxes is actually 1 because * Item 3 fits unrotated * Item 7s fit next to each other rotated Box: +--------------+ | | | | 3 | | 6 | | 0 | | +--------------+ 675 3 +----+ 3 | +-------+ 5 | #3 | #7 | 2 . | +-------+ 5 2 | | #7 | 4 8 +----+-------+ 335.28+330.2 = 665.4 ~15mm spare width, ~10mm spare length The #7s could also fit unrotated (they're narrower than #3 and total depth is less than when rotated) --- tests/PackerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PackerTest.php b/tests/PackerTest.php index 4b3fea35..310b526b 100644 --- a/tests/PackerTest.php +++ b/tests/PackerTest.php @@ -338,7 +338,7 @@ public function testIssue6() { $packer->addItem(new TestItem('Item 7', 330.2, 127, 101.6, 1)); $packedBoxes = $packer->pack(); - self::assertEquals(2, $packedBoxes->count()); + self::assertEquals(1, $packedBoxes->count()); }