Skip to content

Commit 726d3cf

Browse files
Merge branch '4.1' into 4.2
* 4.1: [Twig] Replace for-loops with blocks for attributes fixed CS [Tests] Change to willThrowException [Console] fix PHPDoc in Command Update FileLoaderLoadException.php Fix wrong calls to clearstatcache Add Vietnamese translation for validators Allow running PHPUnit with "xdebug.scream" ON [VarDumper] Add descriptors tests [Yaml] detect circular references [DI] fix reporting bindings on overriden services as unused [Routing] minor fix or previous PR
2 parents 0f4f94a + d66ecb8 commit 726d3cf

6 files changed

+13
-13
lines changed

Tests/Firewall/AbstractPreAuthenticatedListenerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testHandleWhenAuthenticationFails()
9090
->expects($this->once())
9191
->method('authenticate')
9292
->with($this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken'))
93-
->will($this->throwException($exception))
93+
->willThrowException($exception)
9494
;
9595

9696
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(
@@ -138,7 +138,7 @@ public function testHandleWhenAuthenticationFailsWithDifferentToken()
138138
->expects($this->once())
139139
->method('authenticate')
140140
->with($this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken'))
141-
->will($this->throwException($exception))
141+
->willThrowException($exception)
142142
;
143143

144144
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(
@@ -228,7 +228,7 @@ public function testHandleWithAnInvalidSimilarToken()
228228
->expects($this->once())
229229
->method('authenticate')
230230
->with($this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken'))
231-
->will($this->throwException($exception))
231+
->willThrowException($exception)
232232
;
233233

234234
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(

Tests/Firewall/RememberMeListenerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testOnCoreSecurityIgnoresAuthenticationExceptionThrownByAuthenti
9090
$manager
9191
->expects($this->once())
9292
->method('authenticate')
93-
->will($this->throwException($exception))
93+
->willThrowException($exception)
9494
;
9595

9696
$event = $this->getGetResponseEvent();
@@ -132,7 +132,7 @@ public function testOnCoreSecurityIgnoresAuthenticationOptionallyRethrowsExcepti
132132
$manager
133133
->expects($this->once())
134134
->method('authenticate')
135-
->will($this->throwException($exception))
135+
->willThrowException($exception)
136136
;
137137

138138
$event = $this->getGetResponseEvent();
@@ -159,7 +159,7 @@ public function testOnCoreSecurityAuthenticationExceptionDuringAutoLoginTriggers
159159
$service
160160
->expects($this->once())
161161
->method('autoLogin')
162-
->will($this->throwException($exception))
162+
->willThrowException($exception)
163163
;
164164

165165
$service

Tests/Firewall/SimplePreAuthenticationListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testHandlecatchAuthenticationException()
7575
->expects($this->once())
7676
->method('authenticate')
7777
->with($this->equalTo($this->token))
78-
->will($this->throwException($exception))
78+
->willThrowException($exception)
7979
;
8080

8181
$this->tokenStorage->expects($this->once())

Tests/HttpUtilsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function testCheckRequestPathWithUrlMatcherAndResourceNotFound()
200200
->expects($this->any())
201201
->method('match')
202202
->with('/')
203-
->will($this->throwException(new ResourceNotFoundException()))
203+
->willThrowException(new ResourceNotFoundException())
204204
;
205205

206206
$utils = new HttpUtils(null, $urlMatcher);
@@ -215,7 +215,7 @@ public function testCheckRequestPathWithUrlMatcherAndMethodNotAllowed()
215215
->expects($this->any())
216216
->method('matchRequest')
217217
->with($request)
218-
->will($this->throwException(new MethodNotAllowedException(array())))
218+
->willThrowException(new MethodNotAllowedException(array()))
219219
;
220220

221221
$utils = new HttpUtils(null, $urlMatcher);
@@ -260,7 +260,7 @@ public function testCheckRequestPathWithUrlMatcherLoadingException()
260260
$urlMatcher
261261
->expects($this->any())
262262
->method('match')
263-
->will($this->throwException(new \RuntimeException()))
263+
->willThrowException(new \RuntimeException())
264264
;
265265

266266
$utils = new HttpUtils(null, $urlMatcher);

Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testAutoLoginThrowsExceptionOnNonExistentToken()
6666
$tokenProvider
6767
->expects($this->once())
6868
->method('loadTokenBySeries')
69-
->will($this->throwException(new TokenNotFoundException('Token not found.')))
69+
->willThrowException(new TokenNotFoundException('Token not found.'))
7070
;
7171
$service->setTokenProvider($tokenProvider);
7272

@@ -92,7 +92,7 @@ public function testAutoLoginReturnsNullOnNonExistentUser()
9292
$userProvider
9393
->expects($this->once())
9494
->method('loadUserByUsername')
95-
->will($this->throwException(new UsernameNotFoundException('user not found')))
95+
->willThrowException(new UsernameNotFoundException('user not found'))
9696
;
9797

9898
$this->assertNull($service->autoLogin($request));

Tests/RememberMe/TokenBasedRememberMeServicesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testAutoLoginThrowsExceptionOnNonExistentUser()
5050
$userProvider
5151
->expects($this->once())
5252
->method('loadUserByUsername')
53-
->will($this->throwException(new UsernameNotFoundException('user not found')))
53+
->willThrowException(new UsernameNotFoundException('user not found'))
5454
;
5555

5656
$this->assertNull($service->autoLogin($request));

0 commit comments

Comments
 (0)