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

This commit is contained in:
Grégoire Pineau 2020-04-07 11:39:41 +02:00
parent 547c99eae5
commit aebe8ae163
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());
}
}