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