1515use Monolog \Handler \GelfHandler ;
1616use Monolog \Level ;
1717use Monolog \Logger ;
18+ use PHPUnit \Framework \Attributes \Test ;
1819
1920class GelfLoggerTest extends TestCase
2021{
21- /** @test */
22+ #[Test]
2223 public function it_should_have_a_gelf_log_channel (): void
2324 {
2425 $ logger = Log::channel ('gelf ' );
@@ -40,7 +41,7 @@ public function it_should_have_a_gelf_log_channel(): void
4041 $ this ->assertInstanceOf (UdpTransport::class, $ transport );
4142 }
4243
43- /** @test */
44+ #[Test]
4445 public function it_should_not_have_any_processor_if_the_config_does_not_have_processors (): void
4546 {
4647 $ this ->expectException (LogicException::class);
@@ -52,7 +53,7 @@ public function it_should_not_have_any_processor_if_the_config_does_not_have_pro
5253 $ handler ->popProcessor ();
5354 }
5455
55- /** @test */
56+ #[Test]
5657 public function it_should_set_system_name_to_current_hostname_if_system_name_is_null (): void
5758 {
5859 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -69,7 +70,7 @@ public function it_should_set_system_name_to_current_hostname_if_system_name_is_
6970 );
7071 }
7172
72- /** @test */
73+ #[Test]
7374 public function it_should_set_system_name_to_custom_value_if_system_name_config_is_provided (): void
7475 {
7576 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -86,7 +87,7 @@ public function it_should_set_system_name_to_custom_value_if_system_name_config_
8687 );
8788 }
8889
89- /** @test */
90+ #[Test]
9091 public function it_should_call_the_tcp_transport_method_when_provided (): void
9192 {
9293 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -102,7 +103,7 @@ public function it_should_call_the_tcp_transport_method_when_provided(): void
102103 $ this ->assertInstanceOf (TcpTransport::class, $ transport );
103104 }
104105
105- /** @test */
106+ #[Test]
106107 public function it_should_call_the_udp_transport_method_when_nothing_is_provided (): void
107108 {
108109 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -117,7 +118,7 @@ public function it_should_call_the_udp_transport_method_when_nothing_is_provided
117118 $ this ->assertInstanceOf (UdpTransport::class, $ transport );
118119 }
119120
120- /** @test */
121+ #[Test]
121122 public function it_should_set_max_length_if_max_length_is_provided (): void
122123 {
123124 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -134,7 +135,7 @@ public function it_should_set_max_length_if_max_length_is_provided(): void
134135 );
135136 }
136137
137- /** @test */
138+ #[Test]
138139 public function it_should_use_default_max_length_when_max_length_is_not_provided (): void
139140 {
140141 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -150,7 +151,7 @@ public function it_should_use_default_max_length_when_max_length_is_not_provided
150151 );
151152 }
152153
153- /** @test */
154+ #[Test]
154155 public function it_should_use_default_max_length_when_max_length_is_null (): void
155156 {
156157 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -167,7 +168,7 @@ public function it_should_use_default_max_length_when_max_length_is_null(): void
167168 );
168169 }
169170
170- /** @test */
171+ #[Test]
171172 public function it_should_call_the_http_transport_method_when_provided (): void
172173 {
173174 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -183,7 +184,7 @@ public function it_should_call_the_http_transport_method_when_provided(): void
183184 $ this ->assertInstanceOf (HttpTransport::class, $ transport );
184185 }
185186
186- /** @test */
187+ #[Test]
187188 public function it_should_set_path_if_path_is_provided (): void
188189 {
189190 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -201,7 +202,7 @@ public function it_should_set_path_if_path_is_provided(): void
201202 $ this ->assertSame ('/custom-path ' , $ this ->getAttribute ($ transport , 'path ' ));
202203 }
203204
204- /** @test */
205+ #[Test]
205206 public function it_should_set_path_to_default_path_if_path_is_null (): void
206207 {
207208 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -222,7 +223,7 @@ public function it_should_set_path_to_default_path_if_path_is_null(): void
222223 );
223224 }
224225
225- /** @test */
226+ #[Test]
226227 public function it_should_set_path_to_default_path_if_path_is_not_provided (): void
227228 {
228229 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -242,7 +243,7 @@ public function it_should_set_path_to_default_path_if_path_is_not_provided(): vo
242243 );
243244 }
244245
245- /** @test */
246+ #[Test]
246247 public function it_should_set_the_ssl_options_for_tcp_transport (): void
247248 {
248249 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -272,7 +273,7 @@ public function it_should_set_the_ssl_options_for_tcp_transport(): void
272273 $ this ->assertEquals ('TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 ' , $ sslOptions ->getCiphers ());
273274 }
274275
275- /** @test */
276+ #[Test]
276277 public function it_should_set_the_ssl_options_for_http_transport (): void
277278 {
278279 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -303,7 +304,7 @@ public function it_should_set_the_ssl_options_for_http_transport(): void
303304 }
304305
305306
306- /** @test */
307+ #[Test]
307308 public function it_should_not_add_ssl_on_tcp_transport_when_the_ssl_config_is_missing_or_set_to_false (): void
308309 {
309310 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -346,7 +347,7 @@ public function it_should_not_add_ssl_on_tcp_transport_when_the_ssl_config_is_mi
346347 $ this ->assertNull ($ this ->getAttribute ($ transport , 'sslOptions ' ));
347348 }
348349
349- /** @test */
350+ #[Test]
350351 public function it_should_not_add_ssl_on_http_transport_when_the_ssl_config_is_missing_or_set_to_false (): void
351352 {
352353 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -387,7 +388,7 @@ public function it_should_not_add_ssl_on_http_transport_when_the_ssl_config_is_m
387388 $ this ->assertNull ($ this ->getAttribute ($ transport , 'sslOptions ' ));
388389 }
389390
390- /** @test */
391+ #[Test]
391392 public function it_should_use_the_default_ssl_options_when_ssl_options_is_missing (): void
392393 {
393394 $ this ->mergeConfig ('logging.channels.gelf ' , [
@@ -431,7 +432,7 @@ public function it_should_use_the_default_ssl_options_when_ssl_options_is_missin
431432 $ this ->assertNull ($ sslOptions ->getCiphers ());
432433 }
433434
434- /** @test */
435+ #[Test]
435436 public function it_should_ignore_errors_when_the_ignore_error_config_is_missing_or_set_to_false (): void
436437 {
437438 $ this ->app ['config ' ]->set ('logging.default ' , 'gelf ' );
0 commit comments