diff --git a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php index 22dc1927b8f28..0d2af05d222f1 100644 --- a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php +++ b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php @@ -128,6 +128,20 @@ public function testCan() $this->assertFalse($workflow->can($subject, 't2')); } + public function testCanWithInitialState() + { + $definition = $this->createComplexWorkflow(); + $workflow = new Workflow($definition, new PropertyAccessorMarkingStore()); + $subject = new \stdClass(); + + $subject->marking = array('b' => 1, 'c' => 1); + $this->assertTrue($workflow->can($subject, 't2')); + + // If you are in place b you should be able to apply t2 + $subject->marking = array('b' => 1); + $this->assertTrue($workflow->can($subject, 't2')); + } + public function testCanWithGuard() { $definition = $this->createComplexWorkflow();