Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4:
  [appveyor] bump cache
  [Twig][Mime] Removed extra quotes in missing package exception message
  [DI] µfix
  Allowing empty secrets to be set
  [DI] add missing property declarations in InlineServiceConfigurator
  [DI] fix detecting short service syntax in yaml
  Supress error from fread when reading a unix pipe
  [HttpClient] Fix scoped client without query option configuration
  [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore
  [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
  • Loading branch information
nicolas-grekas committed Apr 10, 2020
2 parents 4996037 + 86c6380 commit a18961c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MarkingStore/MethodMarkingStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getMarking(object $subject): Marking

$marking = $subject->{$method}();

if (!$marking) {
if (null === $marking) {
return new Marking();
}

Expand Down
12 changes: 12 additions & 0 deletions Tests/MarkingStore/MethodMarkingStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ public function testGetSetMarkingWithSingleState()
$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'));
Expand Down

0 comments on commit a18961c

Please sign in to comment.