Skip to content

Commit

Permalink
support laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Mar 12, 2024
1 parent eee23e1 commit 47938ef
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ jobs:
tools: composer:v2
coverage: none

- name: Install dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
- name: Install Composer dependencies
run: |
if [[ "${{ matrix.php }}" = "8.3" ]]; then sed -i -e 's/\("orchestra\/testbench":[[:space:]]*\)".*"/\1"^9.0"/' composer.json; fi
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
- name: Execute tests
continue-on-error: ${{ matrix.php > 8 }}
run: vendor/bin/phpunit --verbose
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.phpunit.cache
/vendor
composer.lock
.php-cs-fixer.cache
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
},
"require-dev": {
"mockery/mockery": "^0.9|^1.3",
"orchestra/testbench": "^5.19|^6.18|^7.0|^8.0",
"phpunit/phpunit": "^8.5|^9.1|^10.0"
"orchestra/testbench": "^5.19|^6.18|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^8.5|^9.1|^10.0|^11.0"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 9 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false"
beStrictAboutTestsThatDoNotTestAnything="false" bootstrap="vendor/autoload.php" colors="true"
convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true"
processIsolation="false" stopOnError="false" stopOnFailure="false" verbose="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
processIsolation="false" stopOnError="false" stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix="Test.php">./tests</directory>
Expand All @@ -20,4 +15,9 @@
<env name="APP_DEBUG" value="true"/>
<env name="SESSION_DRIVER" value="file"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
5 changes: 0 additions & 5 deletions tests/Console/ParallelCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Recca0120\LaravelParallel\Tests\Console;

use Illuminate\Foundation\Auth\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Response;
use Recca0120\LaravelParallel\Console\ParallelCommand;
use Recca0120\LaravelParallel\ResponseIdentifier;
Expand All @@ -14,9 +12,6 @@

class ParallelCommandTest extends TestCase
{
use RefreshDatabase;
use WithFaker;

/**
* @var User
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Fixtures/SetupDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Recca0120\LaravelParallel\Tests\Fixtures;

use Illuminate\Database\Schema\Builder;
use Illuminate\Support\Facades\Hash;

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

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

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

$schema->dropIfExists('users');
$schema->create('users', function ($table) {
$table->increments('id');
$table->string('email')->unique();
Expand Down

0 comments on commit 47938ef

Please sign in to comment.