bug #36376 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (lyrixx)

This PR was merged into the 4.4 branch.

Discussion
----------

[Workflow] Use a strict comparison when retrieving raw marking in MarkingStore

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #https://github.com/symfony/symfony/issues/36358
| License       | MIT
| Doc PR        |

Commits
-------

a00a2f1115 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore
This commit is contained in:
Grégoire Pineau 2020-04-07 15:25:58 +02:00
commit e129a1655d
2 changed files with 13 additions and 1 deletions

View File

@ -56,7 +56,7 @@ final class MethodMarkingStore implements MarkingStoreInterface
$marking = $subject->{$method}();
if (!$marking) {
if (null === $marking) {
return new Marking();
}

View File

@ -53,6 +53,18 @@ class MethodMarkingStoreTest extends TestCase
$this->assertEquals($marking, $marking2);
}
public function testGetSetMarkingWithSingleStateAndAlmostEmptyPlaceName()
{
$subject = new Subject(0);
$markingStore = new MethodMarkingStore(true);
$marking = $markingStore->getMarking($subject);
$this->assertInstanceOf(Marking::class, $marking);
$this->assertCount(1, $marking->getPlaces());
}
public function testGetMarkingWithValueObject()
{
$subject = new Subject($this->createValueObject('first_place'));