diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index df91562..f9310bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,9 +40,17 @@ jobs: experimental: false composer: v2 - - deps: 'dev' + - deps: 'stable' php: 8.2 + symfony: '6.x' laravel: '10.x' + experimental: false + composer: v2 + + - deps: 'dev' + php: 8.3 + symfony: '6.x' + laravel: '11.x' experimental: true composer: preview diff --git a/CHANGELOG.md b/CHANGELOG.md index 406afcb..a57ed40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========= +2.4.0 +----- + + * Added Laravel 10 support + * Dropped Symfony <5.4 support + 2.0.0 ----- diff --git a/composer.json b/composer.json index 9d44c77..2c42dc1 100644 --- a/composer.json +++ b/composer.json @@ -7,32 +7,31 @@ "require": { "php": "^7.3 || ^8.0", - "illuminate/database": "^8.40 || ^9.0", - "illuminate/events": "^8.12 || ^9.0", - "illuminate/console": "^8.12 || ^9.0", - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", + "illuminate/database": "^8.40 || ^9.0 || ^10.0", + "illuminate/events": "^8.12 || ^9.0 || ^10.0", + "illuminate/console": "^8.12 || ^9.0 || ^10.0", + "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/dependency-injection": "^5.4 || ^6.0", "jdorn/sql-formatter": "^1.2.17" }, "require-dev": { "doctrine/annotations": "1.*", "symfony/maker-bundle": "^1.20", "mockery/mockery": "^1.3", - "symfony/console": "^4.4 || ^5.0 || ^6.0", - "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/finder": "^4.4 || ^5.0 || ^6.0", - "symfony/debug": "^4.4 || ^5.0 || ^6.0", - "symfony/yaml": "^4.4 || ^5.0 || ^6.0", - "symfony/form": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^4.4 || ^5.0 || ^6.0", - "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0", - "symfony/dom-crawler": "^4.4 || ^5.0 || ^6.0", - "symfony/validator": "^4.4 || ^5.0 || ^6.0", - "symfony/security-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/twig-bridge": "^4.4 || ^5.0 || ^6.0", - "symfony/var-dumper": "^4.4 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/http-kernel": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/yaml": "^5.4 || ^6.0", + "symfony/form": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0", + "symfony/browser-kit": "^5.4 || ^6.0", + "symfony/dom-crawler": "^5.4 || ^6.0", + "symfony/validator": "^5.4 || ^6.0", + "symfony/security-bundle": "^5.4 || ^6.0", + "symfony/twig-bundle": "^5.4 || ^6.0", + "symfony/twig-bridge": "^5.4 || ^6.0", + "symfony/var-dumper": "^5.4 || ^6.0", "twig/twig": "^1.26 || ^2.0 || ^3.0", "vimeo/psalm": "^3.18.2 || ^4.0", "psalm/plugin-symfony": "^1.5.0 || ^2.0 || ^3.0" diff --git a/tests/Fixtures/migrations/blank-10.php b/tests/Fixtures/migrations/blank-10.php new file mode 100644 index 0000000..c672e64 --- /dev/null +++ b/tests/Fixtures/migrations/blank-10.php @@ -0,0 +1,24 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('SomeTable'); + } +}; diff --git a/tests/Fixtures/migrations/update-10.php b/tests/Fixtures/migrations/update-10.php new file mode 100644 index 0000000..15a7c37 --- /dev/null +++ b/tests/Fixtures/migrations/update-10.php @@ -0,0 +1,28 @@ +fileManager->allows()->getRelativePathForFutureClass()->with('App\\Seed\\'.$name)->andReturn($path); diff --git a/tests/Migrations/CreatorTest.php b/tests/Migrations/CreatorTest.php index 0adae8a..11422ee 100644 --- a/tests/Migrations/CreatorTest.php +++ b/tests/Migrations/CreatorTest.php @@ -12,6 +12,7 @@ namespace WouterJ\EloquentBundle\Migrations; use Illuminate\Database\Console\Seeds\WithoutModelEvents; +use Illuminate\Database\Eloquent\Casts\Json; use Illuminate\Database\Schema\Blueprint; use PHPUnit\Framework\TestCase; use Symfony\Bundle\MakerBundle\FileManager; @@ -56,7 +57,9 @@ private function expectMigration(string $type, string $name) { $normalize = function ($str) { return preg_replace('/\R/', "\n", $str); }; - if (trait_exists(WithoutModelEvents::class)) { + if (class_exists(Json::class)) { + $type .= '-10'; + } elseif (trait_exists(WithoutModelEvents::class)) { $type .= '-9'; } $expected = $normalize(file_get_contents(__DIR__.'/../Fixtures/migrations/'.$type.'.php'));