3
3
namespace NotificationChannels \WebPush \Test ;
4
4
5
5
use NotificationChannels \WebPush \WebPushMessage ;
6
+ use PHPUnit \Framework \Attributes \Test ;
6
7
use PHPUnit \Framework \TestCase ;
7
8
8
9
class MessageTest extends TestCase
@@ -16,15 +17,15 @@ protected function setUp(): void
16
17
$ this ->message = new WebPushMessage ;
17
18
}
18
19
19
- /** @test */
20
+ #[Test]
20
21
public function title_can_be_set (): void
21
22
{
22
23
$ this ->message ->title ('Message title ' );
23
24
24
25
$ this ->assertEquals ('Message title ' , $ this ->message ->toArray ()['title ' ]);
25
26
}
26
27
27
- /** @test */
28
+ #[Test]
28
29
public function action_can_be_set (): void
29
30
{
30
31
$ this ->message ->action ('Some Action ' , 'some_action ' );
@@ -34,7 +35,7 @@ public function action_can_be_set(): void
34
35
);
35
36
}
36
37
37
- /** @test */
38
+ #[Test]
38
39
public function action_can_be_set_with_icon (): void
39
40
{
40
41
$ this ->message ->action ('Some Action ' , 'some_action ' , '/icon.png ' );
@@ -44,95 +45,95 @@ public function action_can_be_set_with_icon(): void
44
45
);
45
46
}
46
47
47
- /** @test */
48
+ #[Test]
48
49
public function badge_can_be_set (): void
49
50
{
50
51
$ this ->message ->badge ('/badge.jpg ' );
51
52
52
53
$ this ->assertEquals ('/badge.jpg ' , $ this ->message ->toArray ()['badge ' ]);
53
54
}
54
55
55
- /** @test */
56
+ #[Test]
56
57
public function body_can_be_set (): void
57
58
{
58
59
$ this ->message ->body ('Message body ' );
59
60
60
61
$ this ->assertEquals ('Message body ' , $ this ->message ->toArray ()['body ' ]);
61
62
}
62
63
63
- /** @test */
64
+ #[Test]
64
65
public function direction_can_be_set (): void
65
66
{
66
67
$ this ->message ->dir ('rtl ' );
67
68
68
69
$ this ->assertEquals ('rtl ' , $ this ->message ->toArray ()['dir ' ]);
69
70
}
70
71
71
- /** @test */
72
+ #[Test]
72
73
public function icon_can_be_set (): void
73
74
{
74
75
$ this ->message ->icon ('/icon.jpg ' );
75
76
76
77
$ this ->assertEquals ('/icon.jpg ' , $ this ->message ->toArray ()['icon ' ]);
77
78
}
78
79
79
- /** @test */
80
+ #[Test]
80
81
public function image_can_be_set (): void
81
82
{
82
83
$ this ->message ->image ('/image.jpg ' );
83
84
84
85
$ this ->assertEquals ('/image.jpg ' , $ this ->message ->toArray ()['image ' ]);
85
86
}
86
87
87
- /** @test */
88
+ #[Test]
88
89
public function lang_can_be_set (): void
89
90
{
90
91
$ this ->message ->lang ('en ' );
91
92
92
93
$ this ->assertEquals ('en ' , $ this ->message ->toArray ()['lang ' ]);
93
94
}
94
95
95
- /** @test */
96
+ #[Test]
96
97
public function renotify_can_be_set (): void
97
98
{
98
99
$ this ->message ->renotify ();
99
100
100
101
$ this ->assertTrue ($ this ->message ->toArray ()['renotify ' ]);
101
102
}
102
103
103
- /** @test */
104
+ #[Test]
104
105
public function require_interaction_can_be_set (): void
105
106
{
106
107
$ this ->message ->requireInteraction ();
107
108
108
109
$ this ->assertTrue ($ this ->message ->toArray ()['requireInteraction ' ]);
109
110
}
110
111
111
- /** @test */
112
+ #[Test]
112
113
public function tag_can_be_set (): void
113
114
{
114
115
$ this ->message ->tag ('tag1 ' );
115
116
116
117
$ this ->assertEquals ('tag1 ' , $ this ->message ->toArray ()['tag ' ]);
117
118
}
118
119
119
- /** @test */
120
+ #[Test]
120
121
public function vibration_pattern_can_be_set (): void
121
122
{
122
123
$ this ->message ->vibrate ([1 , 2 , 3 ]);
123
124
124
125
$ this ->assertEquals ([1 , 2 , 3 ], $ this ->message ->toArray ()['vibrate ' ]);
125
126
}
126
127
127
- /** @test */
128
+ #[Test]
128
129
public function arbitrary_data_can_be_set (): void
129
130
{
130
131
$ this ->message ->data (['id ' => 1 ]);
131
132
132
133
$ this ->assertEquals (['id ' => 1 ], $ this ->message ->toArray ()['data ' ]);
133
134
}
134
135
135
- /** @test */
136
+ #[Test]
136
137
public function options_can_be_set (): void
137
138
{
138
139
$ this ->message ->options (['ttl ' => 60 ]);
0 commit comments