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

This PR was merged into the 3.4 branch.

Discussion
----------

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

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36358
| License       | MIT
| Doc PR        |

Commits
-------

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

View File

@ -44,7 +44,7 @@ class SingleStateMarkingStore implements MarkingStoreInterface
{
$placeName = $this->propertyAccessor->getValue($subject, $this->property);
if (!$placeName) {
if (null === $placeName) {
return new Marking();
}

View File

@ -30,4 +30,17 @@ class SingleStateMarkingStoreTest extends TestCase
$this->assertEquals($marking, $marking2);
}
public function testAlmostEmptyPlaceName()
{
$subject = new \stdClass();
$subject->myMarks = 0;
$markingStore = new SingleStateMarkingStore('myMarks');
$marking = $markingStore->getMarking($subject);
$this->assertInstanceOf(Marking::class, $marking);
$this->assertCount(1, $marking->getPlaces());
}
}