File tree Expand file tree Collapse file tree 6 files changed +97
-3
lines changed Expand file tree Collapse file tree 6 files changed +97
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Channel implements Targetable
9
9
*
10
10
* @var string
11
11
*/
12
- protected $ channelTag ;
12
+ private $ channelTag ;
13
13
14
14
/**
15
15
* Set channel tag.
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Device implements Targetable
9
9
*
10
10
* @var string
11
11
*/
12
- protected $ deviceId ;
12
+ private $ deviceId ;
13
13
14
14
/**
15
15
* Set recipient device id.
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class Email implements Targetable
11
11
*
12
12
* @var string
13
13
*/
14
- protected $ email ;
14
+ private $ email ;
15
15
16
16
/**
17
17
* Set recipient email.
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace NotificationChannels \Pushbullet \Test \Targets ;
6
+
7
+ use NotificationChannels \Pushbullet \Targets \Channel ;
8
+ use PHPUnit \Framework \TestCase ;
9
+
10
+ /**
11
+ * @coversDefaultClass \NotificationChannels\Pushbullet\Targets\Channel
12
+ */
13
+ class ChannelTest extends TestCase
14
+ {
15
+ /**
16
+ * @test
17
+ *
18
+ * @covers ::__construct
19
+ * @covers ::getTarget
20
+ */
21
+ public function it_is_properly_represented_as_array ()
22
+ {
23
+ $ sut = new Channel ('channelTag ' );
24
+
25
+ $ this ->assertEquals (['channel_tag ' => 'channelTag ' ], $ sut ->getTarget ());
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace NotificationChannels \Pushbullet \Test \Targets ;
6
+
7
+ use NotificationChannels \Pushbullet \Targets \Device ;
8
+ use PHPUnit \Framework \TestCase ;
9
+
10
+ /**
11
+ * @coversDefaultClass \NotificationChannels\Pushbullet\Targets\Device
12
+ */
13
+ class DeviceTest extends TestCase
14
+ {
15
+ /**
16
+ * @test
17
+ *
18
+ * @covers ::__construct
19
+ * @covers ::getTarget
20
+ */
21
+ public function it_is_properly_represented_as_array ()
22
+ {
23
+ $ sut = new Device ('deviceId ' );
24
+
25
+ $ this ->assertEquals (['device_iden ' => 'deviceId ' ], $ sut ->getTarget ());
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace NotificationChannels \Pushbullet \Test \Targets ;
6
+
7
+ use NotificationChannels \Pushbullet \Exceptions \CouldNotSendNotification ;
8
+ use NotificationChannels \Pushbullet \Targets \Email ;
9
+ use PHPUnit \Framework \TestCase ;
10
+
11
+ /**
12
+ * @coversDefaultClass \NotificationChannels\Pushbullet\Targets\Email
13
+ */
14
+ class EmailTest extends TestCase
15
+ {
16
+ /**
17
+ * @test
18
+ *
19
+ * @covers ::__construct
20
+ * @covers ::getTarget
21
+ */
22
+ public function it_is_properly_represented_as_array ()
23
+ {
24
+ $ sut =
new Email (
'[email protected] ' );
25
+
26
+ $ this ->
assertEquals ([
'email ' =>
'[email protected] ' ],
$ sut->
getTarget ());
27
+ }
28
+
29
+ /**
30
+ * @test
31
+ *
32
+ * @covers ::__construct
33
+ */
34
+ public function invalid_email_is_not_accepted ()
35
+ {
36
+ $ this ->expectException (CouldNotSendNotification::class);
37
+
38
+ $ sut = new Email ('email ' );
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments