@@ -36,13 +36,13 @@ public function it_can_send_a_status_update_notification()
36
36
{
37
37
$ this ->twitter ->shouldReceive ('post ' )
38
38
->once ()
39
- ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], false )
39
+ ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], true )
40
40
->andReturn ([]);
41
41
42
42
$ this ->twitter ->shouldReceive ('getLastHttpCode ' )
43
43
->once ()
44
- ->andReturn (200 );
45
-
44
+ ->andReturn (201 );
45
+
46
46
$ this ->channel ->send (new TestNotifiable (), new TestNotification ());
47
47
}
48
48
@@ -60,8 +60,8 @@ public function it_can_send_a_status_update_notification_with_images()
60
60
->once ()
61
61
->with (
62
62
'tweets ' ,
63
- ['text ' => 'Laravel Notification Channels are awesome! ' , 'media_ids ' => ' 2 ' ],
64
- false
63
+ ['text ' => 'Laravel Notification Channels are awesome! ' , 'media ' => [ ' media_ids ' => [ 2 ]] ],
64
+ true
65
65
)
66
66
->andReturn ([]);
67
67
@@ -72,7 +72,7 @@ public function it_can_send_a_status_update_notification_with_images()
72
72
73
73
$ this ->twitter ->shouldReceive ('getLastHttpCode ' )
74
74
->once ()
75
- ->andReturn (200 );
75
+ ->andReturn (201 );
76
76
77
77
$ this ->channel ->send (new TestNotifiable (), new TestNotificationWithImage ());
78
78
}
@@ -96,8 +96,8 @@ public function it_can_send_a_status_update_notification_with_videos()
96
96
->once ()
97
97
->with (
98
98
'tweets ' ,
99
- ['text ' => 'Laravel Notification Channels are awesome! ' , 'media_ids ' => ' 2 ' ],
100
- false
99
+ ['text ' => 'Laravel Notification Channels are awesome! ' , 'media ' => [ ' media_ids ' => [ 2 ]] ],
100
+ true
101
101
)
102
102
->andReturn ([]);
103
103
@@ -117,13 +117,13 @@ public function it_can_send_a_status_update_notification_with_videos()
117
117
118
118
$ this ->twitter ->shouldReceive ('getLastHttpCode ' )
119
119
->once ()
120
- ->andReturn (200 );
120
+ ->andReturn (201 );
121
121
122
122
$ this ->channel ->send (new TestNotifiable (), new TestNotificationWithVideo ());
123
123
}
124
124
125
125
/** @test */
126
- public function it_can_send_a_status_update_notification_with_reply_to_status_id (): void
126
+ public function it_can_send_a_status_update_notification_with_reply_to_tweet_id (): void
127
127
{
128
128
$ postParams = [
129
129
'text ' => 'Laravel Notification Channels are awesome! ' ,
@@ -132,27 +132,25 @@ public function it_can_send_a_status_update_notification_with_reply_to_status_id
132
132
133
133
$ this ->twitter ->shouldReceive ('post ' )
134
134
->once ()
135
- ->with ('tweets ' , $ postParams , false )
135
+ ->with ('tweets ' , $ postParams , true )
136
136
->andReturn ([]);
137
137
138
138
$ this ->twitter ->shouldReceive ('getLastHttpCode ' )
139
139
->once ()
140
- ->andReturn (200 );
140
+ ->andReturn (201 );
141
141
142
142
$ this ->channel ->send (new TestNotifiable (), new TestNotificationWithReplyToStatusId ($ replyToStatusId ));
143
143
}
144
144
145
145
/** @test */
146
146
public function it_throws_an_exception_when_it_could_not_send_the_notification ()
147
147
{
148
- $ messageObject = new stdClass ;
149
- $ messageObject ->message = 'Error message ' ;
150
148
$ twitterResponse = new stdClass ;
151
- $ twitterResponse ->errors [] = $ messageObject ;
149
+ $ twitterResponse ->detail = ' Error Message ' ;
152
150
153
151
$ this ->twitter ->shouldReceive ('post ' )
154
152
->once ()
155
- ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], false );
153
+ ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], true );
156
154
157
155
$ this ->twitter ->shouldReceive ('getLastHttpCode ' )
158
156
->once ()
@@ -197,7 +195,7 @@ public function it_throws_an_exception_when_it_could_not_send_the_notification_w
197
195
->once ()
198
196
->with ($ media ->media_id_string )
199
197
->andReturn ($ status );
200
-
198
+
201
199
$ this ->expectException (CouldNotSendNotification::class);
202
200
203
201
$ this ->channel ->send (new TestNotifiable (), new TestNotificationWithVideo ());
0 commit comments