10000 Merge remote-tracking branch 'origin/3.4' into 4.4 · enflow/symfony@0506f8c · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.

Commit 0506f8c

Browse files
committed
Merge remote-tracking branch 'origin/3.4' into 4.4
* origin/3.4: [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
2 parents e129a16 + 932a4f8 commit 0506f8c

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
@@ -45,7 +45,7 @@ public function getMarking($subject)
4545
{
4646
$placeName = $this->propertyAccessor->getValue($subject, $this->property);
4747

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

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,17 @@ public function testGetSetMarking()
3131

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

0 commit comments

Comments
 (0)
0