10000 [Workflow] Added more tests · symfony/symfony@e47cfe9 · GitHub
[go: up one dir, main page]

Skip to content

Commit e47cfe9

Browse files
committed
[Workflow] Added more tests
1 parent efa74c5 commit e47cfe9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Symfony/Component/Workflow/Tests/WorkflowTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,23 @@ public function testCan()
104104

105105
$this->assertTrue($workflow->can($subject, 't1'));
106106
$this->assertFalse($workflow->can($subject, 't2'));
107+
108+
$subject->marking = array('b' => 1);
109+
110+
$this->assertFalse($workflow->can($subject, 't1'));
111+
// In a workflow net, all "from" places should contain a token to enable
112+
// the transition.
113+
$this->assertFalse($workflow->can($subject, 't2'));
114+
115+
$subject->marking = array('b' => 1, 'c' => 1);
116+
117+
$this->assertFalse($workflow->can($subject, 't1'));
118+
$this->assertTrue($workflow->can($subject, 't2'));
119+
120+
$subject->marking = array('f' => 1);
121+
122+
$this->assertFalse($workflow->can($subject, 't5'));
123+
$this->assertTrue($workflow->can($subject, 't6'));
107124
}
108125

109126
public function testCanWithGuard()

0 commit comments

Comments
 (0)
0