22
33namespace CodeZero \UriTranslator \Tests \Feature ;
44
5+ use PHPUnit \Framework \Attributes \Test ;
56use CodeZero \UriTranslator \Tests \TestCase ;
67use Illuminate \Support \Facades \Lang ;
78
8- class UriTranslatorTest extends TestCase
9+ final class UriTranslatorTest extends TestCase
910{
10- /** @test */
11- public function it_translates_every_segment_in_a_uri_to_the_current_locale ()
11+ #[Test]
12+ public function it_translates_every_segment_in_a_uri_to_the_current_locale (): void
1213 {
1314 $ this ->setTranslations ([
1415 'nl ' => [
@@ -26,8 +27,8 @@ public function it_translates_every_segment_in_a_uri_to_the_current_locale()
2627 $ this ->assertEquals ('mijn/nieuwe/pagina ' , trans ()->uri ('my/new/page ' ));
2728 }
2829
29- /** @test */
30- public function it_translates_every_segment_in_a_uri_to_the_given_locale ()
30+ #[Test]
31+ public function it_translates_every_segment_in_a_uri_to_the_given_locale (): void
3132 {
3233 $ this ->setTranslations ([
3334 'nl ' => [
@@ -40,8 +41,8 @@ public function it_translates_every_segment_in_a_uri_to_the_given_locale()
4041 $ this ->assertEquals ('mijn/nieuwe/pagina ' , Lang::uri ('my/new/page ' , 'nl ' ));
4142 }
4243
43- /** @test */
44- public function it_uses_the_original_values_if_a_translation_does_not_exist ()
44+ #[Test]
45+ public function it_uses_the_original_values_if_a_translation_does_not_exist (): void
4546 {
4647 $ this ->setTranslations ([
4748 'nl ' => [
@@ -54,8 +55,8 @@ public function it_uses_the_original_values_if_a_translation_does_not_exist()
5455 $ this ->assertEquals ('my/new/page ' , Lang::uri ('my/new/page ' , 'fr ' ));
5556 }
5657
57- /** @test */
58- public function it_ignores_trailing_slashes ()
58+ #[Test]
59+ public function it_ignores_trailing_slashes (): void
5960 {
6061 $ this ->setTranslations ([
6162 'nl ' => [
@@ -68,8 +69,8 @@ public function it_ignores_trailing_slashes()
6869 $ this ->assertEquals ('mijn/nieuwe/pagina ' , Lang::uri ('/my/new/page/ ' , 'nl ' ));
6970 }
7071
71- /** @test */
72- public function it_skips_placeholders_in_a_uri ()
72+ #[Test]
73+ public function it_skips_placeholders_in_a_uri (): void
7374 {
7475 $ this ->setTranslations ([
7576 'nl ' => [
@@ -80,8 +81,8 @@ public function it_skips_placeholders_in_a_uri()
8081 $ this ->assertEquals ('artikels/{articles} ' , Lang::uri ('articles/{articles} ' , 'nl ' ));
8182 }
8283
83- /** @test */
84- public function you_can_translate_a_full_uri ()
84+ #[Test]
85+ public function you_can_translate_a_full_uri (): void
8586 {
8687 $ this ->setTranslations ([
8788 'nl ' => [
@@ -94,8 +95,8 @@ public function you_can_translate_a_full_uri()
9495 $ this ->assertEquals ('producten/glazen ' , Lang::uri ('products/glass ' , 'nl ' ));
9596 }
9697
97- /** @test */
98- public function you_can_translate_a_full_uri_with_placeholder ()
98+ #[Test]
99+ public function you_can_translate_a_full_uri_with_placeholder (): void
99100 {
100101 $ this ->setTranslations ([
101102 'nl ' => [
@@ -108,8 +109,8 @@ public function you_can_translate_a_full_uri_with_placeholder()
108109 $ this ->assertEquals ('producten/glazen/{type} ' , Lang::uri ('products/glass/{type} ' , 'nl ' ));
109110 }
110111
111- /** @test */
112- public function you_can_specify_a_namespace ()
112+ #[Test]
113+ public function you_can_specify_a_namespace (): void
113114 {
114115 $ this ->setTranslations ([
115116 'nl ' => [
@@ -120,8 +121,8 @@ public function you_can_specify_a_namespace()
120121 $ this ->assertEquals ('artikels/{article} ' , Lang::uri ('articles/{article} ' , 'nl ' , 'blog ' ));
121122 }
122123
123- /** @test */
124- public function the_uri_macro_is_available_via_the_trans_helper ()
124+ #[Test]
125+ public function the_uri_macro_is_available_via_the_trans_helper (): void
125126 {
126127 $ this ->setTranslations ([
127128 'nl ' => [
0 commit comments