dimanche 28 octobre 2018

PHPUnit failed assertion on Symfony PreAuthenticatedToken

I am getting the following error when running a PHPUnit test following an upgrade from Symfony 2.8 to 3.4:

Failed asserting that Symfony\Component\VarDumper\Cloner\Data Object &000000007bbb78b60000000050f520a2 ( matches expected 'Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken'.

This is the assertion that previously worked:

$security = $client->getProfile()->getCollector('security');
$this->assertTrue($security->isAuthenticated());
$this->assertEquals(
    'Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken',
    $security->getTokenClass()
);

The assertEquals assertion is the assertion it is failing on.

This is the full output (probably too big to be dumped into a SO question): https://gist.github.com/crmpicco/a927716570a4949caafec4ca1361bf63

What is causing this to fail?

Aucun commentaire:

Enregistrer un commentaire