Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit067ce70

Browse files
committed
minor#22020 [Workflow] Added more tests (lyrixx)
This PR was merged into the 3.2 branch.Discussion----------[Workflow] Added more tests| Q | A| ------------- | ---| Branch? | 3.2| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#22017| License | MIT| Doc PR | ----It's not the first time that people try to fix the workflow because they don't understand how it works. Basically, it's because the default configuration is using the "workflow" and not the "state_machine" type. It was a mistake but it's too late because it will be BC break. May be we could solve that by triggering a deprecation if the type is not explicit. But nobody will see it because it will be triggered during the compilation. It could also be fixed with more documentation.Anyway, I want to add more tests to cover that with a little comment in the test suite. Right now, only one tests failed. With this PR more tests are failing.Commits-------e47cfe9 [Workflow] Added more tests
2 parentsefa74c5 +e47cfe9 commit067ce70

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
publicfunctiontestCanWithGuard()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp