7
7
use NotificationChannels \Twilio \Exceptions \InvalidConfigException ;
8
8
use NotificationChannels \Twilio \Tests \IntegrationTestCase ;
9
9
use NotificationChannels \Twilio \TwilioChannel ;
10
+ use NotificationChannels \Twilio \TwilioConfig ;
11
+ use NotificationChannels \Twilio \TwilioProvider ;
12
+ use Twilio \Rest \Client ;
10
13
11
14
class TwilioProviderTest extends IntegrationTestCase
12
15
{
13
- public function testThatApplicationCannotCreateChannelWithoutConfig ()
16
+ /** @test */
17
+ public function it_cannot_create_the_application_without_config ()
14
18
{
15
19
$ this ->expectException (InvalidConfigException::class);
16
20
17
21
$ this ->app ->get (TwilioChannel::class);
18
22
}
19
23
20
- public function testThatApplicationCannotCreateChannelWithoutSid ()
24
+ /** @test */
25
+ public function it_cannot_create_the_application_without_sid ()
21
26
{
22
27
$ this ->app ['config ' ]->set ('twilio-notification-channel.username ' , 'test ' );
23
28
$ this ->app ['config ' ]->set ('twilio-notification-channel.username ' , 'password ' );
@@ -26,12 +31,23 @@ public function testThatApplicationCannotCreateChannelWithoutSid()
26
31
$ this ->app ->get (TwilioChannel::class);
27
32
}
28
33
29
- public function testThatApplicationCreatesChannelWithConfig ()
34
+ /** @test */
35
+ public function it_can_create_the_application_with_sid ()
30
36
{
31
37
$ this ->app ['config ' ]->set ('twilio-notification-channel.username ' , 'test ' );
32
38
$ this ->app ['config ' ]->set ('twilio-notification-channel.password ' , 'password ' );
33
39
$ this ->app ['config ' ]->set ('twilio-notification-channel.account_sid ' , '1234 ' );
34
40
35
41
$ this ->assertInstanceOf (TwilioChannel::class, $ this ->app ->get (TwilioChannel::class));
36
42
}
43
+
44
+ /** @test */
45
+ public function it_provides_three_classes ()
46
+ {
47
+ $ provides = (new TwilioProvider ($ this ->app ))->provides ();
48
+
49
+ $ this ->assertTrue (in_array (TwilioChannel::class, $ provides ));
50
+ $ this ->assertTrue (in_array (TwilioConfig::class, $ provides ));
51
+ $ this ->assertTrue (in_array (Client::class, $ provides ));
52
+ }
37
53
}
0 commit comments