Skip to content

Commit

Permalink
Write test to exercise rotation as best choice
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Aug 10, 2013
1 parent 17d0176 commit 477b8ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">.</directory>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
Expand Down
13 changes: 13 additions & 0 deletions tests/PackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,17 @@ public function testPackThreeItemsBottom2FitSideBySideWithSpareSpaceOneOverhangS
self::assertEquals(3, $packedItems->count());
}

public function testPackSingleItemFitsBetterRotated() {

$box = new TestBox('Le box', 400, 300, 10, 10, 396, 296, 8, 1000);

$items = new ItemList;
$items->insert(new TestItem('Item 1', 250, 290, 2, 200));

$packer = new Packer();
$packedItems = $packer->packBox($box, $items);

self::assertEquals(1, $packedItems->count());
}

}

0 comments on commit 477b8ed

Please sign in to comment.