| @@ 225-234 (lines=10) @@ | ||
| 222 | ||
| 223 | } |
|
| 224 | ||
| 225 | public function testIssue9() |
|
| 226 | { |
|
| 227 | $packer = new Packer(); |
|
| 228 | $packer->addBox(new TestBox('24x24x24Box', 24, 24, 24, 24, 24, 24, 24, 100)); |
|
| 229 | ||
| 230 | $packer->addItem(new TestItem('6x6x6Item', 6, 6, 6, 1, true), 64); |
|
| 231 | $packedBoxes = $packer->pack(); |
|
| 232 | ||
| 233 | self::assertEquals(1, $packedBoxes->count()); |
|
| 234 | } |
|
| 235 | ||
| 236 | public function testIssue11() |
|
| 237 | { |
|
| @@ 274-282 (lines=9) @@ | ||
| 271 | self::assertEquals(1, $packedBoxes->count()); |
|
| 272 | } |
|
| 273 | ||
| 274 | public function testIssue47A() |
|
| 275 | { |
|
| 276 | $packer = new Packer(); |
|
| 277 | $packer->addBox(new TestBox('165x225x25Box', 165, 225, 25, 0, 165, 225, 25, 100)); |
|
| 278 | $packer->addItem(new TestItem('20x69x20Item', 20, 69, 20, 0, true), 23); |
|
| 279 | $packedBoxes = $packer->pack(); |
|
| 280 | ||
| 281 | self::assertEquals(1, $packedBoxes->count()); |
|
| 282 | } |
|
| 283 | ||
| 284 | public function testIssue47B() |
|
| 285 | { |
|
| @@ 284-292 (lines=9) @@ | ||
| 281 | self::assertEquals(1, $packedBoxes->count()); |
|
| 282 | } |
|
| 283 | ||
| 284 | public function testIssue47B() |
|
| 285 | { |
|
| 286 | $packer = new Packer(); |
|
| 287 | $packer->addBox(new TestBox('165x225x25Box', 165, 225, 25, 0, 165, 225, 25, 100)); |
|
| 288 | $packer->addItem(new TestItem('20x69x20Item', 69, 20, 20, 0, true), 23); |
|
| 289 | $packedBoxes = $packer->pack(); |
|
| 290 | ||
| 291 | self::assertEquals(1, $packedBoxes->count()); |
|
| 292 | } |
|
| 293 | ||
| 294 | public function testIssue47C() |
|
| 295 | { |
|
| @@ 294-302 (lines=9) @@ | ||
| 291 | self::assertEquals(1, $packedBoxes->count()); |
|
| 292 | } |
|
| 293 | ||
| 294 | public function testIssue47C() |
|
| 295 | { |
|
| 296 | $packer = new Packer(); |
|
| 297 | $packer->addBox(new TestBox('Box', 11.75, 23.6875, 3, 0, 11.75, 23.6875, 3, 70)); |
|
| 298 | $packer->addItem(new TestItem('Item', 3.75, 6.5, 3, 0, true), 9); |
|
| 299 | $packedBoxes = $packer->pack(); |
|
| 300 | ||
| 301 | self::assertEquals(1, $packedBoxes->count()); |
|
| 302 | } |
|
| 303 | ||
| 304 | public function testIssue47D() |
|
| 305 | { |
|
| @@ 304-312 (lines=9) @@ | ||
| 301 | self::assertEquals(1, $packedBoxes->count()); |
|
| 302 | } |
|
| 303 | ||
| 304 | public function testIssue47D() |
|
| 305 | { |
|
| 306 | $packer = new Packer(); |
|
| 307 | $packer->addBox(new TestBox('Box', 11.75, 23.6875, 3, 0, 11.75, 23.6875, 3, 70)); |
|
| 308 | $packer->addItem(new TestItem('Item', 6.5, 3.75, 3, 0, true), 9); |
|
| 309 | $packedBoxes = $packer->pack(); |
|
| 310 | ||
| 311 | self::assertEquals(1, $packedBoxes->count()); |
|
| 312 | } |
|
| 313 | ||
| 314 | public function testPackerPacksRotatedBoxesInNewRow() |
|
| 315 | { |
|
| @@ 157-165 (lines=9) @@ | ||
| 154 | self::assertEquals(1, $packedBox->getItems()->count()); |
|
| 155 | } |
|
| 156 | ||
| 157 | public function testIssue20() |
|
| 158 | { |
|
| 159 | $packer = new Packer(); |
|
| 160 | $packer->addBox(new TestBox('Le grande box', 100, 100, 300, 1, 100,100, 300, 1500)); |
|
| 161 | $packer->addItem(new TestItem('Item 1', 150, 50, 50, 20, false)); |
|
| 162 | $packedBoxes = $packer->pack(); |
|
| 163 | ||
| 164 | self::assertEquals(1, $packedBoxes->count()); |
|
| 165 | } |
|
| 166 | ||
| 167 | public function testIssue53() |
|
| 168 | { |
|
| @@ 211-221 (lines=11) @@ | ||
| 208 | self::assertEquals(3.3, $packedBox->getRemainingDepth()); |
|
| 209 | } |
|
| 210 | ||
| 211 | public function testConstraints() |
|
| 212 | { |
|
| 213 | TestConstrainedTestItem::$limit = 2; |
|
| 214 | ||
| 215 | $packer = new Packer(); |
|
| 216 | $packer->addBox(new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 0)); |
|
| 217 | $packer->addItem(new TestConstrainedTestItem('Item', 1, 1, 1, 0, false), 8); |
|
| 218 | $packedBoxes = $packer->pack(); |
|
| 219 | ||
| 220 | self::assertEquals(4, $packedBoxes->count()); |
|
| 221 | } |
|
| 222 | } |
|
| 223 | ||