Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhemphill committed Dec 17, 2024
1 parent 7d5e516 commit cc16213
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/MachineryUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
namespace Hemp\Machinery\Tests;

use Hemp\Machinery\InvalidStateTransition;
use Hemp\Machinery\MachineryEnumeration;
use Hemp\Machinery\MachineryState;
use Hemp\Machinery\Tests\Fixtures\Status;
use PHPUnit\Framework\TestCase;

class MachineryUnitTest extends TestCase
{
public function testModelStateCanBeTransitionedUsingTransitionTo()
public function testStateCanBeTransitionedUsingTransitionTo()
{
$this->assertEquals(Status::Inactive, Status::Active->transitionTo(Status::Inactive));
}
Expand All @@ -32,4 +34,11 @@ public function testSideEffectsAreExecuted()

$this->assertTrue($affected);
}

public function testReferencingAMissingStateThrowsAnError()
{
$this->expectException(\Error::class);

Status::Active->transitionTo('MissingState');
}
}

0 comments on commit cc16213

Please sign in to comment.