Skip to content

Commit 81d2138

Browse files
authored
Merge pull request #57 from coderflexx/l11-upgrade
Laravel 11.x Support
2 parents 636c1cc + e75e66a commit 81d2138

File tree

4 files changed

+25
-26
lines changed

4 files changed

+25
-26
lines changed

.github/workflows/run-tests.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: run-tests
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [main]
8+
branches:
9+
- main
810

911
jobs:
1012
test:
@@ -13,23 +15,17 @@ jobs:
1315
fail-fast: true
1416
matrix:
1517
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.*"]
1820
stability: [prefer-lowest, prefer-stable]
1921
include:
2022
- laravel: 10.*
2123
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
2626
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
3329

3430
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
3531

composer.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@
1616
}
1717
],
1818
"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",
2222
"jaybizzle/crawler-detect": "^1.2",
2323
"spatie/laravel-package-tools": "^1.9.2"
2424
},
2525
"require-dev": {
26-
"nunomaduro/collision": "^5.10|^6.1|^7.0",
26+
"nunomaduro/collision": "^7.0|^8.0",
2727
"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",
3130
"phpstan/extension-installer": "^1.1",
3231
"phpstan/phpstan-deprecation-rules": "^1.0",
3332
"phpstan/phpstan-phpunit": "^1.0",

tests/Pest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
use Coderflex\Laravisit\Tests\TestCase;
4-
use Illuminate\Foundation\Testing\RefreshDatabase;
54

6-
uses(TestCase::class, RefreshDatabase::class)
7-
->in(__DIR__);
5+
uses(TestCase::class)->in(__DIR__);
6+
7+
beforeEach()->setupDatabases();

tests/TestCase.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
use Coderflex\Laravisit\LaravisitServiceProvider;
66
use Illuminate\Database\Eloquent\Factories\Factory;
7+
use Illuminate\Support\Facades\Schema;
78
use Orchestra\Testbench\TestCase as Orchestra;
89

9-
class TestCase extends Orchestra
10+
abstract class TestCase extends Orchestra
1011
{
1112
protected function setUp(): void
1213
{
1314
parent::setUp();
1415

16+
$this->setupDatabases($this->app);
17+
1518
Factory::guessFactoryNamesUsing(
1619
fn (string $modelName) => 'Coderflex\\Laravisit\\Database\\Factories\\'.class_basename($modelName).'Factory'
1720
);
@@ -24,14 +27,15 @@ protected function getPackageProviders($app)
2427
];
2528
}
2629

27-
public function getEnvironmentSetUp($app)
30+
public function setupDatabases($app)
2831
{
2932
config()->set('database.default', 'sqlite');
3033
config()->set('database.connections.sqlite', [
3134
'driver' => 'sqlite',
3235
'database' => ':memory:',
3336
]);
3437

38+
Schema::dropAllTables();
3539

3640
// load laravisits migration
3741
$migration = include __DIR__ . '/../database/migrations/create_laravisits_table.php.stub';

0 commit comments

Comments
 (0)