| @@ 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), 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), 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), 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), 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), 9); |
|
| 309 | $packedBoxes = $packer->pack(); |
|
| 310 | ||
| 311 | self::assertEquals(1, $packedBoxes->count()); |
|
| 312 | } |
|
| 313 | ||
| 314 | public function testPackerPacksRotatedBoxesInNewRow() |
|
| 315 | { |
|
| @@ 201-211 (lines=11) @@ | ||
| 198 | self::assertEquals(3.3, $packedBox->getRemainingDepth()); |
|
| 199 | } |
|
| 200 | ||
| 201 | public function testConstraints() |
|
| 202 | { |
|
| 203 | TestConstrainedTestItem::$limit = 2; |
|
| 204 | ||
| 205 | $packer = new Packer(); |
|
| 206 | $packer->addBox(new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 0)); |
|
| 207 | $packer->addItem(new TestConstrainedTestItem('Item', 1, 1, 1, 0), 8); |
|
| 208 | $packedBoxes = $packer->pack(); |
|
| 209 | ||
| 210 | self::assertEquals(4, $packedBoxes->count()); |
|
| 211 | } |
|
| 212 | } |
|
| 213 | ||