55namespace App \Tests \Functional ;
66
77use App \Tests \Support \FunctionalTester ;
8- use PHPUnit \Framework \Error \ Warning ;
8+ use PHPUnit \Framework \AssertionFailedError ;
99
1010final class NotifierCest
1111{
1212 public function assertNotificationSubjectContains (FunctionalTester $ I )
1313 {
1414 $ I ->registerUser ('jane_doe@gmail.com ' , '123456 ' , followRedirects: false );
15- $ I ->expectThrowable (Warning ::class, function () {
15+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
1616 $ notification = $ I ->getNotifierMessage ();
1717 $ I ->assertNotificationSubjectContains ($ notification , 'created! ' );
1818 });
@@ -21,7 +21,7 @@ public function assertNotificationSubjectContains(FunctionalTester $I)
2121 public function assertNotificationSubjectNotContains (FunctionalTester $ I )
2222 {
2323 $ I ->registerUser ('jane_doe@gmail.com ' , '123456 ' , followRedirects: false );
24- $ I ->expectThrowable (Warning ::class, function () {
24+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
2525 $ notification = $ I ->getNotifierMessage ();
2626 $ I ->assertNotificationSubjectNotContains ($ notification , 'Account not created! ' );
2727 });
@@ -30,7 +30,7 @@ public function assertNotificationSubjectNotContains(FunctionalTester $I)
3030 public function assertNotificationTransportIsEqual (FunctionalTester $ I )
3131 {
3232 $ I ->registerUser ('jane_doe@gmail.com ' , '123456 ' , followRedirects: false );
33- $ I ->expectThrowable (Warning ::class, function () {
33+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
3434 $ notification = $ I ->getNotifierMessage ();
3535 $ I ->assertNotificationTransportIsEqual ($ notification );
3636 });
@@ -39,7 +39,7 @@ public function assertNotificationTransportIsEqual(FunctionalTester $I)
3939 public function assertNotificationTransportIsNotEqual (FunctionalTester $ I )
4040 {
4141 $ I ->registerUser ('jane_doe@gmail.com ' , '123456 ' , followRedirects: false );
42- $ I ->expectThrowable (Warning ::class, function () {
42+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
4343 $ notification = $ I ->getNotifierMessage ();
4444 $ I ->assertNotificationTransportIsNotEqual ($ notification , 'chat ' );
4545 });
@@ -48,7 +48,7 @@ public function assertNotificationTransportIsNotEqual(FunctionalTester $I)
4848 public function dontSeeNotificationIsSent (FunctionalTester $ I )
4949 {
5050 $ I ->registerUser ('john_doe@gmail.com ' , '123456 ' , followRedirects: false );
51- $ I ->expectThrowable (Warning ::class, function () {
51+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
5252 // There is already an account with this notification
5353 $ I ->dontSeeNotificationIsSent ();
5454 });
@@ -57,7 +57,7 @@ public function dontSeeNotificationIsSent(FunctionalTester $I)
5757 public function grabLastSentNotification (FunctionalTester $ I )
5858 {
5959 $ I ->registerUser ('jane_doe@gmail.com ' , '123456 ' , followRedirects: false );
60- $ I ->expectThrowable (Warning ::class, function () {
60+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
6161 $ notification = $ I ->grabLastSentNotification ();
6262 $ I ->assertSame ('Account created! ' , $ notification ->getSubject ());
6363 });
@@ -66,7 +66,7 @@ public function grabLastSentNotification(FunctionalTester $I)
6666 public function grabSentNotifications (FunctionalTester $ I )
6767 {
6868 $ I ->registerUser ('jane_doe@gmail.com ' , '123456 ' , followRedirects: false );
69- $ I ->expectThrowable (Warning ::class, function () {
69+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
7070 $ notifications = $ I ->grabSentNotifications ();
7171 $ subject = $ notifications [0 ]->getSubject ();
7272 $ I ->assertSame ('Account created! ' , $ subject );
@@ -76,7 +76,7 @@ public function grabSentNotifications(FunctionalTester $I)
7676 public function seeNotificationIsSent (FunctionalTester $ I )
7777 {
7878 $ I ->registerUser ('jane_doe@gmail.com ' , '123456 ' , followRedirects: false );
79- $ I ->expectThrowable (Warning ::class, function () {
79+ $ I ->expectThrowable (AssertionFailedError ::class, function () use ( $ I ) {
8080 $ I ->seeNotificationIsSent ();
8181 });
8282 }
0 commit comments