Skip to content

Commit

Permalink
Block rotation status test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Goran committed Sep 5, 2023
1 parent 3a5cd5e commit 5414e35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":947:{a:2:{s:7:"defects";a:7:{s:49:"Padam87\BinPacker\Tests\BinPackerTest::testSimple";i:4;s:51:"Padam87\BinPacker\Tests\BinPackerTest::testRotation";i:3;s:51:"Padam87\BinPacker\Tests\BinPackerTest::testOverflow";i:3;s:49:"Padam87\BinPacker\Tests\BinPackerTest::testGrowth";i:3;s:50:"Padam87\BinPacker\Tests\VisualizerTest::testSimple";i:5;s:54:"Padam87\BinPacker\Tests\VisualizerTest::testStepByStep";i:5;s:52:"Padam87\BinPacker\Tests\GifMakerTest::testStepByStep";i:4;}s:5:"times";a:7:{s:49:"Padam87\BinPacker\Tests\BinPackerTest::testSimple";d:0.003;s:51:"Padam87\BinPacker\Tests\BinPackerTest::testRotation";d:0;s:51:"Padam87\BinPacker\Tests\BinPackerTest::testOverflow";d:0.009;s:49:"Padam87\BinPacker\Tests\BinPackerTest::testGrowth";d:0.01;s:50:"Padam87\BinPacker\Tests\VisualizerTest::testSimple";d:0.116;s:54:"Padam87\BinPacker\Tests\VisualizerTest::testStepByStep";d:0.232;s:52:"Padam87\BinPacker\Tests\GifMakerTest::testStepByStep";d:3.206;}}}
{"version":1,"defects":[],"times":{"Padam87\\BinPacker\\Tests\\BinPackerTest::testSimple":0.237,"Padam87\\BinPacker\\Tests\\BinPackerTest::testRotation":0.011,"Padam87\\BinPacker\\Tests\\BinPackerTest::testRotationStatus":0,"Padam87\\BinPacker\\Tests\\BinPackerTest::testOverflow":0.021,"Padam87\\BinPacker\\Tests\\BinPackerTest::testGrowth":0.024}}
16 changes: 16 additions & 0 deletions tests/Functional/BinPackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ public function testRotation()
$this->assertFalse($nonRotatable->getNode() && $nonRotatable->getNode()->isUsed());
}

public function testRotationStatus()
{
$bin = new Bin(2000, 100);

$rotatable = new Block(100, 1000);

$blocks = [$rotatable];

$packer = new BinPacker();

$blocks = $packer->pack($bin, $blocks);

$this->assertTrue($rotatable->getNode() && $rotatable->isRotated());

}

public function testOverflow()
{
$bin = new Bin(1000, 1000);
Expand Down

0 comments on commit 5414e35

Please sign in to comment.