99use Binarcode \LaravelDeveloper \Tests \TestCase ;
1010use Exception ;
1111use Illuminate \Notifications \AnonymousNotifiable ;
12- use Illuminate \Support \Facades \App ;
1312use Illuminate \Support \Facades \Notification ;
1413
1514class SlackHelperTest extends TestCase
@@ -18,10 +17,6 @@ public function test_slack_helper_returns_laravel_developer_instance(): void
1817 {
1918 Notification::fake ();
2019
21- App::partialMock ()
22- ->shouldReceive ('environment ' )
23- ->andReturn ('dev ' );
24-
2520 $ this ->assertInstanceOf (Slack::class, slack ());
2621 $ this ->assertInstanceOf (Slack::class, slack ('message ' ));
2722 $ this ->assertInstanceOf (Slack::class, slack (new Exception ()));
@@ -31,10 +26,6 @@ public function test_slack_helper_can_send_message_to_slack(): void
3126 {
3227 Notification::fake ();
3328
34- App::partialMock ()
35- ->shouldReceive ('environment ' )
36- ->andReturn ('dev ' );
37-
3829 $ this ->assertInstanceOf (Slack::class, slack ('message ' ));
3930
4031 Notification::assertSentTo (new AnonymousNotifiable (), DevNotification::class);
@@ -48,10 +39,6 @@ public function test_slack_helper_can_send_throwable_to_slack(): void
4839 'developer.developer_log_base_url ' => 'app.test/{id} ' ,
4940 ]);
5041
51- App::partialMock ()
52- ->shouldReceive ('environment ' )
53- ->andReturn ('dev ' );
54-
5542 $ this ->assertInstanceOf (Slack::class, slack (new Exception ('not found ' , 404 ))->persist ());
5643
5744 $ this ->assertDatabaseCount ('developer_logs ' , 1 );
@@ -67,25 +54,21 @@ public function test_slack_helper_can_send_throwable_to_slack(): void
6754 DevNotification::class,
6855 function (DevNotification $ class ) use ($ uuid ) {
6956 return $ class ->notificationDto ->attachment_link === "app.test/ {$ uuid }" ;
70- }
57+ },
7158 );
7259 }
7360
7461 public function test_slack_helper_can_send_notifications_to_slack (): void
7562 {
7663 Notification::fake ();
7764
78- App::partialMock ()
79- ->shouldReceive ('environment ' )
80- ->andReturn ('dev ' );
81-
8265 config ([
8366 'developer.developer_log_base_url ' => 'app.test/{id} ' ,
8467 'developer.slack_dev_hook ' => 'https://test.com ' ,
8568 ]);
8669
8770 $ this ->assertInstanceOf (Slack::class, slack (
88- new DummyNotification ()
71+ new DummyNotification (),
8972 )->persist ());
9073
9174 Notification::assertSentTo (new AnonymousNotifiable (), DummyNotification::class);
0 commit comments