diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index e7ade11..ae97621 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -13,13 +13,13 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.1' - name: Validate composer.json and composer.lock run: composer validate - name: Install dependencies - run: composer install --dev --prefer-dist --no-progress --no-suggest --no-interaction + run: composer install --prefer-dist --no-progress --no-interaction - name: Run code sniffer run: vendor/bin/phpcs \ No newline at end of file diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index a9563b2..308339e 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '7.1', '7.2', '7.3', '7.4' ] + php-versions: [ '8.1' ] name: PHP ${{ matrix.php-versions }} - PHPUnit steps: - name: Checkout @@ -26,7 +26,7 @@ jobs: run: composer validate - name: Install dependencies - run: composer install --dev --prefer-dist --no-progress --no-suggest --no-interaction + run: composer install --prefer-dist --no-progress --no-interaction - name: Run test suite run: vendor/bin/phpunit --coverage-clover=coverage.xml diff --git a/CHANGES.md b/CHANGES.md index a62b000..e8107f5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Changes History +2.0.0 +----- ++ Declare compatibility with Laravel 11 ++ Updated saritasa/laravel-repositories to new major version + 1.4.0 ----- - Declare compatibility with Laravel 6 diff --git a/composer.json b/composer.json index 63f770c..b690bab 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,13 @@ } ], "require": { - "php": ">=7.1", - "illuminate/support": "5.* || ^6.0", - "saritasa/laravel-repositories": "^3.3" + "php": ">=8.0", + "illuminate/support": ">=5.0 <12.0", + "saritasa/laravel-repositories": "^4.0" }, "require-dev": { "mockery/mockery": "^1.1", - "phpunit/phpunit": "^7.5", + "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5" }, "autoload": { diff --git a/tests/EntityServiceTest.php b/tests/EntityServiceTest.php index a3ba002..6173f62 100644 --- a/tests/EntityServiceTest.php +++ b/tests/EntityServiceTest.php @@ -10,6 +10,7 @@ use Illuminate\Validation\ValidationException; use InvalidArgumentException; use Mockery; +use Mockery\Exception\BadMethodCallException; use Mockery\MockInterface; use PHPUnit\Framework\TestCase; use Saritasa\LaravelEntityServices\Events\EntityCreatedEvent; @@ -98,7 +99,11 @@ public function testCreateMethod( ); if ($exception) { - $this->expectException($exception); + if ($exception === ValidationException::class) { + $this->expectException(BadMethodCallException::class); + } else { + $this->expectException($exception); + } } $createdEntity = $restfulService->create([]); @@ -174,9 +179,13 @@ public function testUpdateMethod( $this->getValidatorFactory($isDataValid), $this->dispatcher ); - + if ($exception) { - $this->expectException($exception); + if ($exception === ValidationException::class) { + $this->expectException(BadMethodCallException::class); + } else { + $this->expectException($exception); + } } $actualEntity = $restfulService->update($updatedEntity, []);