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

This commit is contained in:
Grégoire Pineau 2020-04-07 11:51:42 +02:00
parent f72dd9cafa
commit a00a2f1115
2 changed files with 13 additions and 1 deletions

View File

@ -56,7 +56,7 @@ final class MethodMarkingStore implements MarkingStoreInterface
$marking = $subject->{$method}();
if (!$marking) {
if (null === $marking) {
return new Marking();
}

View File

@ -53,6 +53,18 @@ class MethodMarkingStoreTest extends TestCase
$this->assertEquals($marking, $marking2);
}
public function testGetSetMarkingWithSingleStateAndAlmostEmptyPlaceName()
{
$subject = new Subject(0);
$markingStore = new MethodMarkingStore(true);
$marking = $markingStore->getMarking($subject);
$this->assertInstanceOf(Marking::class, $marking);
$this->assertCount(1, $marking->getPlaces());
}
public function testGetMarkingWithValueObject()
{
$subject = new Subject($this->createValueObject('first_place'));