@@ -251,6 +251,10 @@ public function testStatus()
251
251
$ this ->assertNotNull ($ status ->getStatus ());
252
252
}
253
253
254
+ /**
255
+ * @throws \PROCERGS\Sms\Exception\SmsServiceException
256
+ * @throws \PROCERGS\Sms\Exception\TransactionNotFoundException
257
+ */
254
258
public function testStatusError ()
255
259
{
256
260
$ errorResponse = json_encode (
@@ -281,6 +285,28 @@ public function testStatusError()
281
285
$ smsService ->getStatus ($ transactionId );
282
286
}
283
287
288
+ /**
289
+ * @throws \PROCERGS\Sms\Exception\SmsServiceException
290
+ * @throws \PROCERGS\Sms\Exception\TransactionNotFoundException
291
+ */
292
+ public function testStatusNotFound ()
293
+ {
294
+ $ this ->setExpectedException ('PROCERGS\Sms\Exception\TransactionNotFoundException ' );
295
+
296
+ $ transactionId = 'error ' ;
297
+
298
+ $ response = $ this ->getMock ('Symfony\Component\HttpFoundation\Response ' );
299
+ $ response ->expects ($ this ->once ())->method ('isOk ' )->willReturn (false );
300
+ $ response ->expects ($ this ->once ())->method ('isNotFound ' )->willReturn (true );
301
+
302
+ $ restClient = $ this ->getSimpleRestClient ();
303
+ $ restClient ->expects ($ this ->once ())->method ('get ' )->willReturn ($ response );
304
+
305
+ /** @var SmsService $smsService */
306
+ $ smsService = $ this ->getSmsService ($ restClient );
307
+ $ smsService ->getStatus ($ transactionId );
308
+ }
309
+
284
310
private function getSimpleRestClient ($ response = null )
285
311
{
286
312
$ restClient = $ this ->getRestClient ();
0 commit comments