minor #15338 [Security/Http] Fix test relying on a private property (nicolas-grekas)

This PR was merged into the 2.6 branch.

Discussion
----------

[Security/Http] Fix test relying on a private property

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I'm not 100% sure what was tested by this, but this test was using a private property (`AnonymousToken->key`), that has been renamed to `secret` in later Sf versions.

Commits
-------

2d29ac1 [Security/Http] Fix test relying on a private property
This commit is contained in:
Fabien Potencier 2015-07-23 04:10:27 +02:00
commit 713a8b0b31

View File

@ -54,10 +54,9 @@ class AnonymousAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
$authenticationManager
->expects($this->once())
->method('authenticate')
->with(self::logicalAnd(
$this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken'),
$this->attributeEqualTo('key', 'TheKey')
))
->with($this->callback(function ($token) {
return 'TheKey' === $token->getKey();
}))
->will($this->returnValue($anonymousToken))
;