diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46fbbfd..11f5fb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 diff --git a/composer.json b/composer.json index cbef5e1..428b463 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/tests/BatchRetryCommandTest.php b/tests/BatchRetryCommandTest.php index c7d6e44..b7a00d0 100644 --- a/tests/BatchRetryCommandTest.php +++ b/tests/BatchRetryCommandTest.php @@ -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'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 0170761..3075577 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -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]; diff --git a/tests/database/factories/FailedJobFactory.php b/tests/database/factories/FailedJobFactory.php index 1c656a1..f3b3221 100644 --- a/tests/database/factories/FailedJobFactory.php +++ b/tests/database/factories/FailedJobFactory.php @@ -7,7 +7,7 @@ 'connection' => 'database', 'queue' => 'default', 'payload' => [ - 'displayName' => 'App\Jobs\SomeJob', + 'displayName' => 'App\\Jobs\\SomeJob', ], 'exception' => 'something', ];