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
99 *
1010 * @var string
1111 */
12- protected $ channelTag ;
12+ private $ channelTag ;
1313
1414 /**
1515 * Set channel tag.
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Device implements Targetable
99 *
1010 * @var string
1111 */
12- protected $ deviceId ;
12+ private $ deviceId ;
1313
1414 /**
1515 * Set recipient device id.
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class Email implements Targetable
1111 *
1212 * @var string
1313 */
14- protected $ email ;
14+ private $ email ;
1515
1616 /**
1717 * 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@example.com ' );
25+
26+ $ this ->assertEquals (['email ' => 'email@example.com ' ], $ 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