Skip to content

Commit

Permalink
Update testcase for #608
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed May 6, 2024
1 parent b7b87a8 commit 56cb8ab
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions tests/PackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1234,18 +1234,18 @@ public function testIssue608Default(): void
$w += 10;
}

$packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::BestFit), 1);
$packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::KeepFlat), 1);

/** @var PackedBox[] $packedBoxes */
$packedBoxes = iterator_to_array($packer->pack());

self::assertCount(2, $packedBoxes);
self::assertEquals('Box120 2060', $packedBoxes[0]->box->getReference());
self::assertEquals('Box250 1180', $packedBoxes[0]->box->getReference());
self::assertEquals('Box250 2260', $packedBoxes[1]->box->getReference());
}

Expand All @@ -1261,19 +1261,19 @@ public function testIssue608NoWeightRedistribution(): void
$w += 10;
}

$packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::BestFit), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::BestFit), 1);
$packer->addItem(new TestItem('mountings', 282, 110, 160, 500, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 50mm', 2260, 218, 80, 1380, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 35mm ', 1585, 192, 60, 5050, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 50mm', 1175, 218, 80, 5190, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 191, 60, 3210, Rotation::KeepFlat), 1);
$packer->addItem(new TestItem('blind 35mm', 1028, 192, 60, 3200, Rotation::KeepFlat), 1);

/** @var PackedBox[] $packedBoxes */
$packedBoxes = iterator_to_array($packer->pack());

self::assertCount(2, $packedBoxes);
self::assertEquals('Box250 2260', $packedBoxes[0]->box->getReference());
self::assertEquals('Box120 400', $packedBoxes[1]->box->getReference());
self::assertEquals('Box250 2320', $packedBoxes[0]->box->getReference());
self::assertEquals('Box120 1590', $packedBoxes[1]->box->getReference());
}

public function testCustomPackedBoxSorterIsUsed(): void
Expand Down

0 comments on commit 56cb8ab

Please sign in to comment.