10000 bug #36375 [Workflow] Use a strict comparison when retrieving raw mar… · symfony/symfony@932a4f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 932a4f8

Browse files
committed
bug #36375 [Workflow] Use a strict comparison when retrieving raw marking 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
2 parents 547c99e + aebe8ae commit 932a4f8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Symfony/Component/Workflow/MarkingStore/SingleStateMarkingStore.php

Lines changed: 1 addition & 1 deletion
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

src/Symfony/Component/Workflow/Tests/MarkingStore/SingleStateMarkingStoreTest.php

Lines changed: 13 additions & 0 deletions
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)
0