Skip to content

Commit 17aac96

Browse files
committed
fixed obsolete getMock() usage
1 parent 7f5daff commit 17aac96

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Tests/Firewall/ExceptionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testExceptionWhenEntryPointReturnsBadValue()
6969
{
7070
$event = $this->createEvent(new AuthenticationException());
7171

72-
$entryPoint = $this->getMock('Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface');
72+
$entryPoint = $this->getMockBuilder('Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface')->getMock();
7373
$entryPoint->expects($this->once())->method('start')->will($this->returnValue('NOT A RESPONSE'));
7474

7575
$listener = $this->createExceptionListener(null, null, null, $entryPoint);

Tests/Session/SessionAuthenticationStrategyTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testUnsupportedStrategy()
3939

4040
public function testSessionIsMigrated()
4141
{
42-
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
42+
$session = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\SessionInterface')->getMock();
4343
$session->expects($this->once())->method('migrate')->with($this->equalTo(true));
4444

4545
$strategy = new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE);
@@ -48,7 +48,7 @@ public function testSessionIsMigrated()
4848

4949
public function testSessionIsInvalidated()
5050
{
51-
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
51+
$session = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\SessionInterface')->getMock();
5252
$session->expects($this->once())->method('invalidate');
5353

5454
$strategy = new SessionAuthenticationStrategy(SessionAuthenticationStrategy::INVALIDATE);
@@ -57,7 +57,7 @@ public function testSessionIsInvalidated()
5757

5858
private function getRequest($session = null)
5959
{
60-
$request = $this->getMock('Symfony\Component\HttpFoundation\Request');
60+
$request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->getMock();
6161

6262
if (null !== $session) {
6363
$request->expects($this->any())->method('getSession')->will($this->returnValue($session));
@@ -68,6 +68,6 @@ private function getRequest($session = null)
6868

6969
private function getToken()
7070
{
71-
return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
71+
return $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
7272
}
7373
}

0 commit comments

Comments
 (0)