From e47cfe903e629cc2bc18cd649b927bc743110919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Thu, 16 Mar 2017 10:52:38 +0100 Subject: [PATCH] [Workflow] Added more tests --- .../Component/Workflow/Tests/WorkflowTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php index ab8c767b59c17..c1efb0182765a 100644 --- a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php +++ b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php @@ -104,6 +104,23 @@ public function testCan() $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()