13
13
14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \Messenger \Exception \NoHandlerForMessageException ;
16
- use Symfony \Component \Messenger \Middleware \TolerateNoHandler ;
16
+ use Symfony \Component \Messenger \Middleware \AllowNoHandlerMiddleware ;
17
17
use Symfony \Component \Messenger \Tests \Fixtures \DummyMessage ;
18
18
19
- class TolerateNoHandlerTest extends TestCase
19
+ class AllowNoHandlerMiddlewareTest extends TestCase
20
20
{
21
21
public function testItCallsNextMiddlewareAndReturnsItsResult ()
22
22
{
@@ -25,7 +25,7 @@ public function testItCallsNextMiddlewareAndReturnsItsResult()
25
25
$ next = $ this ->createPartialMock (\stdClass::class, array ('__invoke ' ));
26
26
$ next ->expects ($ this ->once ())->method ('__invoke ' )->with ($ message )->willReturn ('Foo ' );
27
27
28
- $ middleware = new TolerateNoHandler ();
28
+ $ middleware = new AllowNoHandlerMiddleware ();
29
29
$ this ->assertSame ('Foo ' , $ middleware ->handle ($ message , $ next ));
30
30
}
31
31
@@ -34,7 +34,7 @@ public function testItCatchesTheNoHandlerException()
34
34
$ next = $ this ->createPartialMock (\stdClass::class, array ('__invoke ' ));
35
35
$ next ->expects ($ this ->once ())->method ('__invoke ' )->will ($ this ->throwException (new NoHandlerForMessageException ()));
36
36
37
- $ middleware = new TolerateNoHandler ();
37
+ $ middleware = new AllowNoHandlerMiddleware ();
38
38
39
39
$ this ->assertNull ($ middleware ->handle (new DummyMessage ('Hey ' ), $ next ));
40
40
}
@@ -48,7 +48,7 @@ public function testItDoesNotCatchOtherExceptions()
48
48
$ next = $ this ->createPartialMock (\stdClass::class, array ('__invoke ' ));
49
49
$ next ->expects ($ this ->once ())->method ('__invoke ' )->will ($ this ->throwException (new \RuntimeException ('Something went wrong. ' )));
50
50
51
- $ middleware = new TolerateNoHandler ();
51
+ $ middleware = new AllowNoHandlerMiddleware ();
52
52
$ middleware ->handle (new DummyMessage ('Hey ' ), $ next );
53
53
}
54
54
}
0 commit comments