Skip to content

Commit

Permalink
bug #36375 [Workflow] Use a strict comparison when retrieving raw mar…
Browse files Browse the repository at this point in the history
…king 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
-------

aebe8ae [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
  • Loading branch information
lyrixx committed Apr 7, 2020
2 parents 547c99e + aebe8ae commit 932a4f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Expand Up @@ -44,7 +44,7 @@ public function getMarking($subject)
{
$placeName = $this->propertyAccessor->getValue($subject, $this->property);

if (!$placeName) {
if (null === $placeName) {
return new Marking();
}

Expand Down
Expand Up @@ -30,4 +30,17 @@ public function testGetSetMarking()

$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());
}
}

0 comments on commit 932a4f8

Please sign in to comment.