@@ -43,16 +43,6 @@ protected function tearDown(): void
4343 $ this ->filesystem ->remove ($ this ->tempDir );
4444 }
4545
46- public function testHandleThrowsExceptionForWrongEvent (): void
47- {
48- $ this ->expectException (InvalidHandlerEventException::class);
49- $ this ->expectExceptionMessageMatches ('/LaravelSqsHandler cannot handle Mock_InvocationEventInterface[^\s]* event/ ' );
50-
51- $ handler = new LaravelSqsHandler ($ this ->getLoggerMock (), $ this ->tempDir );
52-
53- $ handler ->handle ($ this ->getInvocationEventInterfaceMock ());
54- }
55-
5646 public function testCanHandleReturnsFalseForWrongEvent (): void
5747 {
5848 $ handler = new LaravelSqsHandler ($ this ->getLoggerMock (), '/tmp ' );
@@ -80,7 +70,8 @@ public function testHandleCollectsFailuresIfProcessFails(): void
8070
8171 $ logger = $ this ->getLoggerMock ();
8272 $ logger ->expects ($ this ->once ())
83- ->method ('error ' );
73+ ->method ('error ' )
74+ ->with ($ this ->stringContains ('Processing SQS message [id1] failed: Laravel queue job failed ' ));
8475
8576 $ handler = new LaravelSqsHandler ($ logger , '/tmp ' );
8677 $ response = $ handler ->handle ($ event );
@@ -102,7 +93,8 @@ public function testHandleCollectsFailuresOnJsonError(): void
10293
10394 $ logger = $ this ->getLoggerMock ();
10495 $ logger ->expects ($ this ->once ())
105- ->method ('error ' );
96+ ->method ('error ' )
97+ ->with ($ this ->stringContains ('Processing SQS message [id1] failed: Failed to encode SQS message [id1] ' ));
10698
10799 $ handler = new LaravelSqsHandler ($ logger , '/tmp ' );
108100 $ response = $ handler ->handle ($ event );
@@ -114,6 +106,16 @@ public function testHandleCollectsFailuresOnJsonError(): void
114106 ], $ response ->getResponseData ());
115107 }
116108
109+ public function testHandleThrowsExceptionForWrongEvent (): void
110+ {
111+ $ this ->expectException (InvalidHandlerEventException::class);
112+ $ this ->expectExceptionMessageMatches ('/LaravelSqsHandler cannot handle Mock_InvocationEventInterface[^\s]* event/ ' );
113+
114+ $ handler = new LaravelSqsHandler ($ this ->getLoggerMock (), $ this ->tempDir );
115+
116+ $ handler ->handle ($ this ->getInvocationEventInterfaceMock ());
117+ }
118+
117119 public function testHandleUsesEnvironmentVariables (): void
118120 {
119121 $ _ENV ['YMIR_QUEUE_CONNECTION ' ] = 'custom_connection ' ;
0 commit comments