File tree Expand file tree Collapse file tree 4 files changed +57
-23
lines changed Expand file tree Collapse file tree 4 files changed +57
-23
lines changed Original file line number Diff line number Diff line change 69
69
" @php -r \" file_exists('database/database.sqlite') || touch('database/database.sqlite');\" " ,
70
70
" @php artisan migrate --graceful --ansi"
71
71
],
72
- "test" : " XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always "
72
+ "test" : " @php artisan test "
73
73
},
74
74
"extra" : {
75
75
"laravel" : {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Tests \Feature ;
6
+
7
+ // use Illuminate\Foundation\Testing\RefreshDatabase;
8
+
9
+ use PHPUnit \Framework \Attributes \DataProvider ;
10
+ use Tests \TestCase ;
11
+
12
+ class HomePageTest extends TestCase
13
+ {
14
+ public function test_it_redirects_to_the_default_locale (): void
15
+ {
16
+ $ this ->get ('/ ' )
17
+ ->assertRedirect ('/ ' . config ('app.fallback_locale ' ));
18
+ }
19
+
20
+ #[DataProvider('languages ' )]
21
+ public function test_it_can_view_the_home_page_in (string $ language )
22
+ {
23
+ $ this ->get ("/ {$ language }" )
24
+ ->assertStatus (200 );
25
+ }
26
+ }
Original file line number Diff line number Diff line change 8
8
9
9
abstract class TestCase extends BaseTestCase
10
10
{
11
- //
11
+ public static function languages (): array
12
+ {
13
+ return [
14
+ 'bulgarian ' => ['bg ' ],
15
+ 'croatian ' => ['hr ' ],
16
+ 'czech ' => ['cs ' ],
17
+ 'danish ' => ['da ' ],
18
+ 'dutch ' => ['nl ' ],
19
+ 'english ' => ['en ' ],
20
+ 'estonian ' => ['et ' ],
21
+ 'finnish ' => ['fi ' ],
22
+ 'french ' => ['fr ' ],
23
+ 'german ' => ['de ' ],
24
+ 'greek ' => ['el ' ],
25
+ 'hungarian ' => ['hu ' ],
26
+ 'irish ' => ['ga ' ],
27
+ 'italian ' => ['it ' ],
28
+ 'luxembourgish ' => ['lb ' ],
29
+ 'latvian ' => ['lv ' ],
30
+ 'lithuanian ' => ['lt ' ],
31
+ 'maltese ' => ['mt ' ],
32
+ 'polish ' => ['pl ' ],
33
+ 'portuguese ' => ['pt ' ],
34
+ 'romanian ' => ['ro ' ],
35
+ 'slovak ' => ['sk ' ],
36
+ 'slovene ' => ['sl ' ],
37
+ 'spanish ' => ['es ' ],
38
+ 'swedish ' => ['sv ' ],
39
+ ];
40
+ }
12
41
}
You can’t perform that action at this time.
0 commit comments