|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace App\Tests\Functional; |
| 6 | + |
| 7 | +use App\Tests\Support\FunctionalTester; |
| 8 | + |
| 9 | +final class NotifierCest |
| 10 | +{ |
| 11 | + public function assertNotificationSubjectContains(FunctionalTester $I) |
| 12 | + { |
| 13 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 14 | + $notification = $I->getNotifierMessage(); |
| 15 | + $I->assertNotificationSubjectContains($notification, 'created!'); |
| 16 | + } |
| 17 | + |
| 18 | + public function assertNotificationSubjectNotContains(FunctionalTester $I) |
| 19 | + { |
| 20 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 21 | + $notification = $I->getNotifierMessage(); |
| 22 | + $I->assertNotificationSubjectNotContains($notification, 'Account not created!'); |
| 23 | + } |
| 24 | + |
| 25 | + public function assertNotificationTransportIsEqual(FunctionalTester $I) |
| 26 | + { |
| 27 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 28 | + $notification = $I->getNotifierMessage(); |
| 29 | + $I->assertNotificationTransportIsEqual($notification); |
| 30 | + } |
| 31 | + |
| 32 | + public function assertNotificationTransportIsNotEqual(FunctionalTester $I) |
| 33 | + { |
| 34 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 35 | + $notification = $I->getNotifierMessage(); |
| 36 | + $I->assertNotificationTransportIsNotEqual($notification, 'chat'); |
| 37 | + } |
| 38 | + |
| 39 | + public function dontSeeNotificationIsSent(FunctionalTester $I) |
| 40 | + { |
| 41 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 42 | + // There is already an account with this notification |
| 43 | + $I->dontSeeNotificationIsSent(); |
| 44 | + } |
| 45 | + |
| 46 | + public function grabLastSentNotification(FunctionalTester $I) |
| 47 | + { |
| 48 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 49 | + $notification = $I->grabLastSentNotification(); |
| 50 | + $I->assertSame('Account created!', $notification->getSubject()); |
| 51 | + } |
| 52 | + |
| 53 | + public function grabSentNotifications(FunctionalTester $I) |
| 54 | + { |
| 55 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 56 | + $notifications = $I->grabSentNotifications(); |
| 57 | + $subject = $notifications[0]->getSubject(); |
| 58 | + $I->assertSame('Account created!', $subject); |
| 59 | + } |
| 60 | + |
| 61 | + public function seeNotificationIsSent(FunctionalTester $I) |
| 62 | + { |
| 63 | + $I-> registerUser( '[email protected]', '123456', followRedirects: false); |
| 64 | + $I->seeNotificationIsSent(); |
| 65 | + } |
| 66 | +} |
0 commit comments