Skip to content

Commit 452df1b

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [DebugBundle] Remove obsolete VarDumper feature detection Remove obsolete DBAL 2 compat code Fix for TraceableAuthenticator debug when no Auth [TwigBridge] Remove obsolete Workflow feature detection [Console] Remove Process::fromShellCommandline() detection [TwigBridge] Change return type of Symfony\Bridge\Twig\AppVariable::getSession() [mailer] reset $code variable each iteration for prevent wrong codes to be used bug [mailer] fix EsmtpTransport variable $code definition UrlHelper: minor code style fix [Serializer] Looking for DiscriminatorMap on interfaces when the current object also extends from a class [DoctrineBridge][Security] Rename loadUserByUsername tests to loadUserByIdentifier
2 parents d6c3d7d + b69a413 commit 452df1b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Authenticator/Debug/TraceableAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static function (BadgeInterface $badge): array {
5454
'resolved' => $badge->isResolved(),
5555
];
5656
},
57-
$this->passport->getBadges(),
57+
$this->passport?->getBadges() ?? [],
5858
),
5959
];
6060
}

Tests/Authenticator/Debug/TraceableAuthenticatorTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,14 @@ public function testGetInfo()
3636
$this->assertSame($passport, $traceable->authenticate($request));
3737
$this->assertSame($passport, $traceable->getInfo()['passport']);
3838
}
39+
40+
public function testGetInfoWithoutAuth()
41+
{
42+
$authenticator = $this->createMock(AuthenticatorInterface::class);
43+
44+
$traceable = new TraceableAuthenticator($authenticator);
45+
$this->assertNull($traceable->getInfo()['passport']);
46+
$this->assertIsArray($traceable->getInfo()['badges']);
47+
$this->assertSame([], $traceable->getInfo()['badges']);
48+
}
3949
}

0 commit comments

Comments
 (0)