@@ -36,13 +36,13 @@ public function it_can_send_a_status_update_notification()
3636 {
3737 $ this ->twitter ->shouldReceive ('post ' )
3838 ->once ()
39- ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], false )
39+ ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], true )
4040 ->andReturn ([]);
4141
4242 $ this ->twitter ->shouldReceive ('getLastHttpCode ' )
4343 ->once ()
44- ->andReturn (200 );
45-
44+ ->andReturn (201 );
45+
4646 $ this ->channel ->send (new TestNotifiable (), new TestNotification ());
4747 }
4848
@@ -60,8 +60,8 @@ public function it_can_send_a_status_update_notification_with_images()
6060 ->once ()
6161 ->with (
6262 '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
6565 )
6666 ->andReturn ([]);
6767
@@ -72,7 +72,7 @@ public function it_can_send_a_status_update_notification_with_images()
7272
7373 $ this ->twitter ->shouldReceive ('getLastHttpCode ' )
7474 ->once ()
75- ->andReturn (200 );
75+ ->andReturn (201 );
7676
7777 $ this ->channel ->send (new TestNotifiable (), new TestNotificationWithImage ());
7878 }
@@ -96,8 +96,8 @@ public function it_can_send_a_status_update_notification_with_videos()
9696 ->once ()
9797 ->with (
9898 '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
101101 )
102102 ->andReturn ([]);
103103
@@ -117,13 +117,13 @@ public function it_can_send_a_status_update_notification_with_videos()
117117
118118 $ this ->twitter ->shouldReceive ('getLastHttpCode ' )
119119 ->once ()
120- ->andReturn (200 );
120+ ->andReturn (201 );
121121
122122 $ this ->channel ->send (new TestNotifiable (), new TestNotificationWithVideo ());
123123 }
124124
125125 /** @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
127127 {
128128 $ postParams = [
129129 'text ' => 'Laravel Notification Channels are awesome! ' ,
@@ -132,27 +132,25 @@ public function it_can_send_a_status_update_notification_with_reply_to_status_id
132132
133133 $ this ->twitter ->shouldReceive ('post ' )
134134 ->once ()
135- ->with ('tweets ' , $ postParams , false )
135+ ->with ('tweets ' , $ postParams , true )
136136 ->andReturn ([]);
137137
138138 $ this ->twitter ->shouldReceive ('getLastHttpCode ' )
139139 ->once ()
140- ->andReturn (200 );
140+ ->andReturn (201 );
141141
142142 $ this ->channel ->send (new TestNotifiable (), new TestNotificationWithReplyToStatusId ($ replyToStatusId ));
143143 }
144144
145145 /** @test */
146146 public function it_throws_an_exception_when_it_could_not_send_the_notification ()
147147 {
148- $ messageObject = new stdClass ;
149- $ messageObject ->message = 'Error message ' ;
150148 $ twitterResponse = new stdClass ;
151- $ twitterResponse ->errors [] = $ messageObject ;
149+ $ twitterResponse ->detail = ' Error Message ' ;
152150
153151 $ this ->twitter ->shouldReceive ('post ' )
154152 ->once ()
155- ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], false );
153+ ->with ('tweets ' , ['text ' => 'Laravel Notification Channels are awesome! ' ], true );
156154
157155 $ this ->twitter ->shouldReceive ('getLastHttpCode ' )
158156 ->once ()
@@ -197,7 +195,7 @@ public function it_throws_an_exception_when_it_could_not_send_the_notification_w
197195 ->once ()
198196 ->with ($ media ->media_id_string )
199197 ->andReturn ($ status );
200-
198+
201199 $ this ->expectException (CouldNotSendNotification::class);
202200
203201 $ this ->channel ->send (new TestNotifiable (), new TestNotificationWithVideo ());
0 commit comments