Skip to content

Commit

Permalink
Merge pull request #2 from kirschbaum-development/php-8
Browse files Browse the repository at this point in the history
Support to PHP 8
  • Loading branch information
luisdalmolin authored Jul 10, 2021
2 parents d872a59 + 4f4f01c commit 2168886
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4]
laravel: [7.*, 8.*]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 7.*
php: [7.4, 8.0]
laravel: [8.*]

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

Expand All @@ -42,9 +37,7 @@ jobs:
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
run: composer install

- name: Execute tests
run: vendor/bin/phpunit
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
}
],
"require": {
"php": "^7.1"
"php": "^7.1 || ^8.0"
},
"require-dev": {
"orchestra/testbench": "^4.0",
"orchestra/testbench": "^6.0",
"laravel/framework": "^8.0",
"laravel/legacy-factories": "^1.0",
"phpunit/phpunit": "^8.0"
},
"autoload": {
Expand Down
1 change: 1 addition & 0 deletions tests/BatchRetryCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function it_can_retry_all_jobs()
public function making_sure_the_chunks_work()
{
$failedJobs = factory(FailedJob::class, 75)->create();
$this->assertEquals(75, FailedJob::count());

Artisan::call('queue:failed:batch-retry');

Expand Down
6 changes: 6 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public function setUp(): void
$this->loadMigrationsFrom(__DIR__.'/database/migrations');
}

protected function defineEnvironment($app)
{
$app['config']->set('queue.default', 'database');
$app['config']->set('queue.failed.driver', 'database');
}

protected function getPackageProviders($app)
{
return [BatchRetryServiceProvider::class];
Expand Down
2 changes: 1 addition & 1 deletion tests/database/factories/FailedJobFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'connection' => 'database',
'queue' => 'default',
'payload' => [
'displayName' => 'App\Jobs\SomeJob',
'displayName' => 'App\\Jobs\\SomeJob',
],
'exception' => 'something',
];
Expand Down

0 comments on commit 2168886

Please sign in to comment.