22
33namespace Esign \TranslationLoader \Tests \Feature \Commands ;
44
5+ use PHPUnit \Framework \Attributes \Test ;
56use Esign \TranslationLoader \Commands \ImportFileTranslationsToDatabaseCommand ;
67use Esign \TranslationLoader \Models \Translation ;
78use Esign \TranslationLoader \Tests \TestCase ;
89
9- class ImportFileTranslationToDatabaseCommandTest extends TestCase
10+ final class ImportFileTranslationToDatabaseCommandTest extends TestCase
1011{
11- /** @test */
12- public function it_can_import_translations ()
12+ #[Test]
13+ public function it_can_import_translations (): void
1314 {
1415 $ this ->artisan (ImportFileTranslationsToDatabaseCommand::class, ['--locales ' => 'en,nl ' ]);
1516
@@ -21,8 +22,8 @@ public function it_can_import_translations()
2122 ]);
2223 }
2324
24- /** @test */
25- public function it_can_import_translations_for_specific_locales ()
25+ #[Test]
26+ public function it_can_import_translations_for_specific_locales (): void
2627 {
2728 $ this ->artisan (ImportFileTranslationsToDatabaseCommand::class, ['--locales ' => 'en ' ]);
2829
@@ -34,8 +35,8 @@ public function it_can_import_translations_for_specific_locales()
3435 ]);
3536 }
3637
37- /** @test */
38- public function it_wont_overwrite_existing_translations_when_the_overwrite_flag_was_not_given ()
38+ #[Test]
39+ public function it_wont_overwrite_existing_translations_when_the_overwrite_flag_was_not_given (): void
3940 {
4041 Translation::create ([
4142 'group ' => '* ' ,
@@ -54,8 +55,8 @@ public function it_wont_overwrite_existing_translations_when_the_overwrite_flag_
5455 ]);
5556 }
5657
57- /** @test */
58- public function it_can_overwrite_existing_translations ()
58+ #[Test]
59+ public function it_can_overwrite_existing_translations (): void
5960 {
6061 Translation::create ([
6162 'group ' => '* ' ,
@@ -74,8 +75,8 @@ public function it_can_overwrite_existing_translations()
7475 ]);
7576 }
7677
77- /** @test */
78- public function it_wont_overwrite_existing_translations_for_locales_that_were_not_specified ()
78+ #[Test]
79+ public function it_wont_overwrite_existing_translations_for_locales_that_were_not_specified (): void
7980 {
8081 Translation::create ([
8182 'group ' => '* ' ,
@@ -94,17 +95,17 @@ public function it_wont_overwrite_existing_translations_for_locales_that_were_no
9495 ]);
9596 }
9697
97- /** @test */
98- public function it_can_report_the_affected_records ()
98+ #[Test]
99+ public function it_can_report_the_affected_records (): void
99100 {
100101 $ command = $ this ->artisan (ImportFileTranslationsToDatabaseCommand::class, ['--locales ' => 'en ' ]);
101102
102103 $ command ->expectsOutputToContain ('Successfully imported translations, affected records: 1. ' );
103104 $ command ->assertSuccessful ();
104105 }
105106
106- /** @test */
107- public function it_can_report_the_affected_records_when_a_translation_is_already_present ()
107+ #[Test]
108+ public function it_can_report_the_affected_records_when_a_translation_is_already_present (): void
108109 {
109110 Translation::create ([
110111 'group ' => '* ' ,
@@ -118,17 +119,17 @@ public function it_can_report_the_affected_records_when_a_translation_is_already
118119 $ command ->assertSuccessful ();
119120 }
120121
121- /** @test */
122- public function it_can_report_affected_records_when_the_overwrite_flag_is_given ()
122+ #[Test]
123+ public function it_can_report_affected_records_when_the_overwrite_flag_is_given (): void
123124 {
124125 $ command = $ this ->artisan (ImportFileTranslationsToDatabaseCommand::class, ['--locales ' => 'en ' , '--overwrite ' => true ]);
125126
126127 $ command ->expectsOutputToContain ('Successfully imported translations, affected records: 1. ' );
127128 $ command ->assertSuccessful ();
128129 }
129130
130- /** @test */
131- public function it_can_report_affected_records_when_the_overwrite_flag_is_given_and_a_translation_is_already_present ()
131+ #[Test]
132+ public function it_can_report_affected_records_when_the_overwrite_flag_is_given_and_a_translation_is_already_present (): void
132133 {
133134 Translation::create ([
134135 'group ' => '* ' ,
0 commit comments