diff --git a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php index ab8c767b59..c1efb01827 100644 --- a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php +++ b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php @@ -104,6 +104,23 @@ class WorkflowTest extends TestCase $this->assertTrue($workflow->can($subject, 't1')); $this->assertFalse($workflow->can($subject, 't2')); + + $subject->marking = array('b' => 1); + + $this->assertFalse($workflow->can($subject, 't1')); + // In a workflow net, all "from" places should contain a token to enable + // the transition. + $this->assertFalse($workflow->can($subject, 't2')); + + $subject->marking = array('b' => 1, 'c' => 1); + + $this->assertFalse($workflow->can($subject, 't1')); + $this->assertTrue($workflow->can($subject, 't2')); + + $subject->marking = array('f' => 1); + + $this->assertFalse($workflow->can($subject, 't5')); + $this->assertTrue($workflow->can($subject, 't6')); } public function testCanWithGuard()