Skip to content

Commit 47938ef

Browse files
committed
support laravel 11
1 parent eee23e1 commit 47938ef

File tree

6 files changed

+20
-23
lines changed

6 files changed

+20
-23
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ jobs:
2626
tools: composer:v2
2727
coverage: none
2828

29-
- name: Install dependencies
30-
uses: nick-invision/retry@v1
31-
with:
32-
timeout_minutes: 5
33-
max_attempts: 5
34-
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
29+
- name: Install Composer dependencies
30+
run: |
31+
if [[ "${{ matrix.php }}" = "8.3" ]]; then sed -i -e 's/\("orchestra\/testbench":[[:space:]]*\)".*"/\1"^9.0"/' composer.json; fi
32+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
3533
3634
- name: Execute tests
3735
continue-on-error: ${{ matrix.php > 8 }}
38-
run: vendor/bin/phpunit --verbose
36+
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea
2+
.phpunit.cache
23
/vendor
34
composer.lock
45
.php-cs-fixer.cache

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"require-dev": {
2222
"mockery/mockery": "^0.9|^1.3",
23-
"orchestra/testbench": "^5.19|^6.18|^7.0|^8.0",
24-
"phpunit/phpunit": "^8.5|^9.1|^10.0"
23+
"orchestra/testbench": "^5.19|^6.18|^7.0|^8.0|^9.0",
24+
"phpunit/phpunit": "^8.5|^9.1|^10.0|^11.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

phpunit.xml.dist

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false"
33
beStrictAboutTestsThatDoNotTestAnything="false" bootstrap="vendor/autoload.php" colors="true"
4-
convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true"
5-
processIsolation="false" stopOnError="false" stopOnFailure="false" verbose="true"
6-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
7-
<coverage processUncoveredFiles="true">
8-
<include>
9-
<directory suffix=".php">./src</directory>
10-
</include>
11-
</coverage>
4+
processIsolation="false" stopOnError="false" stopOnFailure="false"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache"
6+
backupStaticProperties="false">
127
<testsuites>
138
<testsuite name="Package Test Suite">
149
<directory suffix="Test.php">./tests</directory>
@@ -20,4 +15,9 @@
2015
<env name="APP_DEBUG" value="true"/>
2116
<env name="SESSION_DRIVER" value="file"/>
2217
</php>
18+
<source>
19+
<include>
20+
<directory suffix=".php">./src</directory>
21+
</include>
22+
</source>
2323
</phpunit>

tests/Console/ParallelCommandTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace Recca0120\LaravelParallel\Tests\Console;
44

55
use Illuminate\Foundation\Auth\User;
6-
use Illuminate\Foundation\Testing\RefreshDatabase;
7-
use Illuminate\Foundation\Testing\WithFaker;
86
use Illuminate\Http\Response;
97
use Recca0120\LaravelParallel\Console\ParallelCommand;
108
use Recca0120\LaravelParallel\ResponseIdentifier;
@@ -14,9 +12,6 @@
1412

1513
class ParallelCommandTest extends TestCase
1614
{
17-
use RefreshDatabase;
18-
use WithFaker;
19-
2015
/**
2116
* @var User
2217
*/

tests/Fixtures/SetupDatabase.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Recca0120\LaravelParallel\Tests\Fixtures;
44

5+
use Illuminate\Database\Schema\Builder;
56
use Illuminate\Support\Facades\Hash;
67

78
trait SetupDatabase
@@ -18,8 +19,10 @@ protected function databaseSetUp($app)
1819

1920
$app['config']->set('auth.providers.users.model', User::class);
2021

22+
/** @var Builder $schema */
2123
$schema = $app['db']->getSchemaBuilder();
2224

25+
$schema->dropIfExists('users');
2326
$schema->create('users', function ($table) {
2427
$table->increments('id');
2528
$table->string('email')->unique();

0 commit comments

Comments
 (0)