@@ -21,18 +21,17 @@ class TwitterChannelTest extends TestCase
2121
2222 protected TwitterChannel $ channel ;
2323
24- public function setUp (): void
24+ protected function setUp (): void
2525 {
2626 parent ::setUp ();
2727 $ this ->twitter = m::mock (TwitterOAuth::class, function ($ mock ) {
28- $ mock ->shouldReceive ('setApiVersion ' )
29- ->with ('2 ' );
28+ $ mock ->shouldReceive ('setApiVersion ' )-> with ( ' 1.1 ' );
29+ $ mock -> shouldReceive ( ' setApiVersion ' ) ->with ('2 ' );
3030 });
3131 $ this ->channel = new TwitterChannel ($ this ->twitter );
3232 }
3333
34- /** @test */
35- public function it_can_send_a_status_update_notification ()
34+ public function test_it_can_send_a_status_update_notification ()
3635 {
3736 $ this ->twitter ->shouldReceive ('post ' )
3837 ->once ()
@@ -43,11 +42,10 @@ public function it_can_send_a_status_update_notification()
4342 ->once ()
4443 ->andReturn (201 );
4544
46- $ this ->channel ->send (new TestNotifiable () , new TestNotification () );
45+ $ this ->channel ->send (new TestNotifiable , new TestNotification );
4746 }
4847
49- /** @test */
50- public function it_can_send_a_status_update_notification_with_images ()
48+ public function test_it_can_send_a_status_update_notification_with_images ()
5149 {
5250 $ media = new stdClass ;
5351 $ media ->media_id_string = '2 ' ;
@@ -74,11 +72,10 @@ public function it_can_send_a_status_update_notification_with_images()
7472 ->once ()
7573 ->andReturn (201 );
7674
77- $ this ->channel ->send (new TestNotifiable () , new TestNotificationWithImage () );
75+ $ this ->channel ->send (new TestNotifiable , new TestNotificationWithImage );
7876 }
7977
80- /** @test */
81- public function it_can_send_a_status_update_notification_with_videos ()
78+ public function test_it_can_send_a_status_update_notification_with_videos ()
8279 {
8380 $ media = new stdClass ;
8481 $ media ->media_id_string = '2 ' ;
@@ -97,7 +94,7 @@ public function it_can_send_a_status_update_notification_with_videos()
9794 ->with (
9895 'tweets ' ,
9996 ['text ' => 'Laravel Notification Channels are awesome! ' , 'media ' => ['media_ids ' => [2 ]]],
100- true
97+ [ ' jsonPayload ' => true ]
10198 )
10299 ->andReturn ([]);
103100
@@ -119,11 +116,10 @@ public function it_can_send_a_status_update_notification_with_videos()
119116 ->once ()
120117 ->andReturn (201 );
121118
122- $ this ->channel ->send (new TestNotifiable () , new TestNotificationWithVideo () );
119+ $ this ->channel ->send (new TestNotifiable , new TestNotificationWithVideo );
123120 }
124121
125- /** @test */
126- public function it_can_send_a_status_update_notification_with_reply_to_tweet_id (): void
122+ public function test_it_can_send_a_status_update_notification_with_reply_to_tweet_id (): void
127123 {
128124 $ postParams = [
129125 'text ' => 'Laravel Notification Channels are awesome! ' ,
@@ -139,11 +135,10 @@ public function it_can_send_a_status_update_notification_with_reply_to_tweet_id(
139135 ->once ()
140136 ->andReturn (201 );
141137
142- $ this ->channel ->send (new TestNotifiable () , new TestNotificationWithReplyToStatusId ($ replyToStatusId ));
138+ $ this ->channel ->send (new TestNotifiable , new TestNotificationWithReplyToStatusId ($ replyToStatusId ));
143139 }
144140
145- /** @test */
146- public function it_throws_an_exception_when_it_could_not_send_the_notification ()
141+ public function test_it_throws_an_exception_when_it_could_not_send_the_notification ()
147142 {
148143 $ twitterResponse = new stdClass ;
149144 $ twitterResponse ->detail = 'Error Message ' ;
@@ -162,11 +157,10 @@ public function it_throws_an_exception_when_it_could_not_send_the_notification()
162157
163158 $ this ->expectException (CouldNotSendNotification::class);
164159
165- $ this ->channel ->send (new TestNotifiable () , new TestNotification () );
160+ $ this ->channel ->send (new TestNotifiable , new TestNotification );
166161 }
167162
168- /** @test */
169- public function it_throws_an_exception_when_it_could_not_send_the_notification_with_videos ()
163+ public function test_it_throws_an_exception_when_it_could_not_send_the_notification_with_videos ()
170164 {
171165 $ media = new stdClass ;
172166 $ media ->media_id_string = '2 ' ;
@@ -198,7 +192,7 @@ public function it_throws_an_exception_when_it_could_not_send_the_notification_w
198192
199193 $ this ->expectException (CouldNotSendNotification::class);
200194
201- $ this ->channel ->send (new TestNotifiable () , new TestNotificationWithVideo () );
195+ $ this ->channel ->send (new TestNotifiable , new TestNotificationWithVideo );
202196 }
203197}
204198
0 commit comments