Skip to content

Commit

Permalink
Add testcases for #275
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Jul 9, 2023
1 parent 8483017 commit 4b67b2a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions tests/PackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,61 @@ public function testIssue334(): void
self::assertCount(1, $packedBoxes);
}

public function testIssue275A(): void
{
$packer = new Packer();
$packer->setMaxBoxesToBalanceWeight(0);
$packer->addBox(new TestBox('EuroPallet', 1200, 800, 2150, 0, 1200, 800, 2150, 400000));
$packer->addItem(new TestItem('height 39', 590, 390, 390, 10880, Rotation::KeepFlat), 5);
$packer->addItem(new TestItem('height 47', 590, 390, 470, 10890, Rotation::KeepFlat), 6);
$packer->addItem(new TestItem('height 33', 590, 390, 330, 10060, Rotation::KeepFlat), 9);
$packedBoxes = $packer->pack();

self::assertCount(1, $packedBoxes);
}

public function testIssue275B(): void
{
$this->markTestSkipped();
$packer = new Packer();
$packer->setMaxBoxesToBalanceWeight(0);
$packer->addBox(new TestBox('EuroPallet', 1200, 800, 2150, 0, 1200, 800, 2150, 400000));
$packer->addItem(new TestItem('height 39', 590, 390, 390, 10880, Rotation::BestFit), 5);
$packer->addItem(new TestItem('height 47', 590, 390, 470, 10890, Rotation::BestFit), 6);
$packer->addItem(new TestItem('height 33', 590, 390, 330, 10060, Rotation::BestFit), 9);
$packedBoxes = $packer->pack();

self::assertCount(1, $packedBoxes);
}

public function testIssue275C(): void
{
$this->markTestSkipped();
$packer = new Packer();
$packer->setMaxBoxesToBalanceWeight(0);
$packer->addBox(new TestBox('EuroPallet', 1200, 800, 2150, 0, 1200, 800, 2150, 400000));
$packer->addItem(new TestItem('height 39', 590, 390, 390, 10880, Rotation::KeepFlat), 5);
$packer->addItem(new TestItem('height 47', 590, 470, 390, 10890, Rotation::KeepFlat), 6);
$packer->addItem(new TestItem('height 33', 590, 390, 330, 10060, Rotation::KeepFlat), 9);
$packedBoxes = $packer->pack();

self::assertCount(1, $packedBoxes);
}

public function testIssue275D(): void
{
$this->markTestSkipped();
$packer = new Packer();
$packer->setMaxBoxesToBalanceWeight(0);
$packer->addBox(new TestBox('EuroPallet', 1200, 800, 2150, 0, 1200, 800, 2150, 400000));
$packer->addItem(new TestItem('height 39', 590, 390, 390, 10880, Rotation::BestFit), 5);
$packer->addItem(new TestItem('height 47', 590, 470, 390, 10890, Rotation::BestFit), 6);
$packer->addItem(new TestItem('height 33', 590, 390, 330, 10060, Rotation::BestFit), 9);
$packedBoxes = $packer->pack();

self::assertCount(1, $packedBoxes);
}

public function testCustomPackedBoxSorterIsUsed(): void
{
PackedBoxByReferenceSorter::$reference = 'Box #1';
Expand Down

0 comments on commit 4b67b2a

Please sign in to comment.