Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix some tests
  • Loading branch information
wouterj committed Jun 29, 2015
commit b0e22e279fb41158cd487076fb6eaadb919fecb5
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testHandleWithTokenStorageHavingAToken()
->method('authenticate')
;

$listener = new AnonymousAuthenticationListener($tokenStorage, 'TheKey', null, $authenticationManager);
$listener = new AnonymousAuthenticationListener($tokenStorage, 'TheSecret', null, $authenticationManager);
$listener->handle($this->getMock('Symfony\Component\HttpKernel\Event\GetResponseEvent', array(), array(), '', false));
}

Expand All @@ -48,15 +48,15 @@ public function testHandleWithTokenStorageHavingNoToken()
->will($this->returnValue(null))
;

$anonymousToken = new AnonymousToken('TheKey', 'anon.', array());
$anonymousToken = new AnonymousToken('TheSecret', 'anon.', array());

$authenticationManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface');
$authenticationManager
->expects($this->once())
->method('authenticate')
->with(self::logicalAnd(
$this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken'),
$this->attributeEqualTo('key', 'TheKey')
$this->attributeEqualTo('secret', 'TheSecret')
))
->will($this->returnValue($anonymousToken))
;
Expand All @@ -67,7 +67,7 @@ public function testHandleWithTokenStorageHavingNoToken()
->with($anonymousToken)
;

$listener = new AnonymousAuthenticationListener($tokenStorage, 'TheKey', null, $authenticationManager);
$listener = new AnonymousAuthenticationListener($tokenStorage, 'TheSecret', null, $authenticationManager);
$listener->handle($this->getMock('Symfony\Component\HttpKernel\Event\GetResponseEvent', array(), array(), '', false));
}

Expand All @@ -82,7 +82,7 @@ public function testHandledEventIsLogged()

$authenticationManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface');

$listener = new AnonymousAuthenticationListener($tokenStorage, 'TheKey', $logger, $authenticationManager);
$listener = new AnonymousAuthenticationListener($tokenStorage, 'TheSecret', $logger, $authenticationManager);
$listener->handle($this->getMock('Symfony\Component\HttpKernel\Event\GetResponseEvent', array(), array(), '', false));
}
}