File tree 4 files changed +25
-26
lines changed
4 files changed +25
-26
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ name: run-tests
2
2
3
3
on :
4
4
push :
5
- branches : [main]
5
+ branches :
6
+ - main
6
7
pull_request :
7
- branches : [main]
8
+ branches :
9
+ - main
8
10
9
11
jobs :
10
12
test :
@@ -13,23 +15,17 @@ jobs:
13
15
fail-fast : true
14
16
matrix :
15
17
os : [ubuntu-latest, windows-latest]
16
- php : [8.2 , 8.1 , 8.0 ]
17
- laravel : [10.*, 9.*, 8.* ]
18
+ php : [8.1 , 8.2 , 8.3 ]
19
+ laravel : [" 10.*", "11.*" ]
18
20
stability : [prefer-lowest, prefer-stable]
19
21
include :
20
22
- laravel : 10.*
21
23
testbench : ^8.0
22
- - laravel : 9.*
23
- testbench : ^7.0.0
24
- - laravel : 8.*
25
- testbench : ^6.23
24
+ - laravel : 11.*
25
+ testbench : ^9.0
26
26
exclude :
27
- - laravel : 8.*
28
- php : 8.2
29
- - laravel : 9.*
30
- php : 8.2
31
- - laravel : 10.*
32
- php : 8.0
27
+ - laravel : 11.*
28
+ php : 8.1
33
29
34
30
name : P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
35
31
Original file line number Diff line number Diff line change 16
16
}
17
17
],
18
18
"require" : {
19
- "php" : " ^8.0 " ,
20
- "coderflexx/laravel-presenter" : " ^1.1 " ,
21
- "illuminate/contracts" : " ^8 .0|^9.0|^10 .0" ,
19
+ "php" : " ^8.1 " ,
20
+ "coderflexx/laravel-presenter" : " ^2.0 " ,
21
+ "illuminate/contracts" : " ^10 .0|^11 .0" ,
22
22
"jaybizzle/crawler-detect" : " ^1.2" ,
23
23
"spatie/laravel-package-tools" : " ^1.9.2"
24
24
},
25
25
"require-dev" : {
26
- "nunomaduro/collision" : " ^5.10|^6.1|^7 .0" ,
26
+ "nunomaduro/collision" : " ^7.0|^8 .0" ,
27
27
"nunomaduro/larastan" : " ^1.0|^2.0" ,
28
- "orchestra/testbench" : " ^6.23|^7.0.0|^8.0" ,
29
- "pestphp/pest" : " ^1.22" ,
30
- "pestphp/pest-plugin-laravel" : " ^1.1" ,
28
+ "orchestra/testbench" : " ^8.0|^9.0" ,
29
+ "pestphp/pest" : " ^1.22|^2.34" ,
31
30
"phpstan/extension-installer" : " ^1.1" ,
32
31
"phpstan/phpstan-deprecation-rules" : " ^1.0" ,
33
32
"phpstan/phpstan-phpunit" : " ^1.0" ,
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use Coderflex \Laravisit \Tests \TestCase ;
4
- use Illuminate \Foundation \Testing \RefreshDatabase ;
5
4
6
- uses (TestCase::class, RefreshDatabase::class)
7
- ->in (__DIR__ );
5
+ uses (TestCase::class)->in (__DIR__ );
6
+
7
+ beforeEach ()->setupDatabases ();
Original file line number Diff line number Diff line change 4
4
5
5
use Coderflex \Laravisit \LaravisitServiceProvider ;
6
6
use Illuminate \Database \Eloquent \Factories \Factory ;
7
+ use Illuminate \Support \Facades \Schema ;
7
8
use Orchestra \Testbench \TestCase as Orchestra ;
8
9
9
- class TestCase extends Orchestra
10
+ abstract class TestCase extends Orchestra
10
11
{
11
12
protected function setUp (): void
12
13
{
13
14
parent ::setUp ();
14
15
16
+ $ this ->setupDatabases ($ this ->app );
17
+
15
18
Factory::guessFactoryNamesUsing (
16
19
fn (string $ modelName ) => 'Coderflex \\Laravisit \\Database \\Factories \\' .class_basename ($ modelName ).'Factory '
17
20
);
@@ -24,14 +27,15 @@ protected function getPackageProviders($app)
24
27
];
25
28
}
26
29
27
- public function getEnvironmentSetUp ($ app )
30
+ public function setupDatabases ($ app )
28
31
{
29
32
config ()->set ('database.default ' , 'sqlite ' );
30
33
config ()->set ('database.connections.sqlite ' , [
31
34
'driver ' => 'sqlite ' ,
32
35
'database ' => ':memory: ' ,
33
36
]);
34
37
38
+ Schema::dropAllTables ();
35
39
36
40
// load laravisits migration
37
41
$ migration = include __DIR__ . '/../database/migrations/create_laravisits_table.php.stub ' ;
You can’t perform that action at this time.
0 commit comments