Skip to content

Commit b46e9ae

Browse files
committed
[Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
1 parent 5e9ac66 commit b46e9ae

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

MarkingStore/SingleStateMarkingStore.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getMarking($subject)
4444
{
4545
$placeName = $this->propertyAccessor->getValue($subject, $this->property);
4646

47-
if (!$placeName) {
47+
if (null === $placeName) {
4848
return new Marking();
4949
}
5050

Tests/MarkingStore/SingleStateMarkingStoreTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,17 @@ public function testGetSetMarking()
3030

3131
$this->assertEquals($marking, $marking2);
3232
}
33+
34+
public function testAlmostEmptyPlaceName()
35+
{
36+
$subject = new \stdClass();
37+
$subject->myMarks = 0;
38+
39+
$markingStore = new SingleStateMarkingStore('myMarks');
40+
41+
$marking = $markingStore->getMarking($subject);
42+
43+
$this->assertInstanceOf(Marking::class, $marking);
44+
$this->assertCount(1, $marking->getPlaces());
45+
}
3346
}

0 commit comments

Comments
 (0)