Skip to content

Commit

Permalink
[Workflow] Use a strict comparison when retrieving raw markin in Mark…
Browse files Browse the repository at this point in the history
…ingStore
  • Loading branch information
lyrixx committed Apr 7, 2020
1 parent 5e9ac66 commit b46e9ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MarkingStore/SingleStateMarkingStore.php
Original file line number Diff line number Diff line change
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
13 changes: 13 additions & 0 deletions Tests/MarkingStore/SingleStateMarkingStoreTest.php
Original file line number Diff line number Diff line change
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 b46e9ae

Please sign in to comment.