diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index dc0a6d3..d0afd8c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,11 +8,13 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.1, 8.0] - laravel: [9.*] + php: [8.2, 8.1] + laravel: [10.*, 9.*] framework: [tailwind, tailwind-2, tailwind-forms-simple, bootstrap-4, bootstrap-5] dependency-version: [prefer-lowest, prefer-stable] include: + - laravel: 10.* + testbench: 8.* - laravel: 9.* testbench: 7.* diff --git a/composer.json b/composer.json index 9ea0304..423bfc0 100644 --- a/composer.json +++ b/composer.json @@ -29,17 +29,17 @@ } ], "require": { - "php": "^8.0 || ^8.1 || ^8.2", - "illuminate/support": "^9.0", + "php": "^8.1 || ^8.2", + "illuminate/support": "^9.0 || ^10.0", "symfony/http-foundation": "^6.0" }, "require-dev": { - "livewire/livewire": "^2.0", - "mockery/mockery": "^1.3.3", - "nesbot/carbon": "^2.63", - "orchestra/testbench-browser-kit": "^7.0", + "livewire/livewire": "^2.12", + "mockery/mockery": "^1.4.4", + "nesbot/carbon": "^2.66", + "orchestra/testbench-browser-kit": "^7.0 || ^8.0", "phpunit/phpunit": "^9.5", - "spatie/laravel-translatable": "^5.0", + "spatie/laravel-translatable": "^6.0", "symfony/dom-crawler": "^6.0" }, "autoload": { @@ -68,4 +68,4 @@ ] } } -} +} \ No newline at end of file diff --git a/tests/Feature/LivewireTest.php b/tests/Feature/LivewireTest.php index cadd659..a069dc4 100644 --- a/tests/Feature/LivewireTest.php +++ b/tests/Feature/LivewireTest.php @@ -98,8 +98,8 @@ public function it_can_validate_the_fields() ->assertSeeHtml('The textarea field is required') ->assertSeeHtml('The select field is required') ->assertSeeHtml('The multi select field is required') - ->assertSeeHtml('The checkbox must be accepted') - ->assertSeeHtml('The radio must be accepted'); + ->assertSeeHtml(TestCase::isLaravel10() ? 'The checkbox field must be accepted' : 'The checkbox must be accepted') + ->assertSeeHtml(TestCase::isLaravel10() ? 'The radio field must be accepted' : 'The radio must be accepted'); } /** @test */ @@ -125,8 +125,8 @@ public function it_can_add_a_modifier_to_the_wire_directive() ->assertSeeHtml('The textarea field is required') ->assertSeeHtml('The select field is required') ->assertSeeHtml('The multi select field is required') - ->assertSeeHtml('The checkbox must be accepted') - ->assertSeeHtml('The radio must be accepted'); + ->assertSeeHtml(TestCase::isLaravel10() ? 'The checkbox field must be accepted' : 'The checkbox must be accepted') + ->assertSeeHtml(TestCase::isLaravel10() ? 'The radio field must be accepted' : 'The radio must be accepted'); } /** @test */ diff --git a/tests/Feature/MultipleSelectTest.php b/tests/Feature/MultipleSelectTest.php index 5bebb27..fbc945d 100644 --- a/tests/Feature/MultipleSelectTest.php +++ b/tests/Feature/MultipleSelectTest.php @@ -22,6 +22,6 @@ public function it_posts_all_selected_options() ->press('Submit') ->seeElement('option[value="be"]:selected') ->seeElement('option[value="nl"]:selected') - ->seeText('The select must be a string.'); + ->seeText(static::isLaravel10() ? 'The select field must be a string.' : 'The select must be a string.'); } } diff --git a/tests/Feature/TranslationTest.php b/tests/Feature/TranslationTest.php index 1100044..a747905 100644 --- a/tests/Feature/TranslationTest.php +++ b/tests/Feature/TranslationTest.php @@ -52,7 +52,7 @@ public function it_shows_the_validation_errors_and_old_values_correctly() ->press('Submit') ->seeElement('input[name="input[nl]"][value="hoi"]') ->seeElement('input[name="input[en]"][value="hey"]') - ->seeText('The input.nl must be at least 5 characters') - ->seeText('The input.en must be at least 5 characters'); + ->seeText(static::isLaravel10() ? 'The input.nl field must be at least 5 characters' : 'The input.nl must be at least 5 characters') + ->seeText(static::isLaravel10() ? 'The input.en field must be at least 5 characters' : 'The input.en must be at least 5 characters'); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 1bb40cb..ea6b08c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -12,6 +12,11 @@ abstract class TestCase extends BaseTestCase { protected $baseUrl = 'http://localhost'; + public static function isLaravel10(): bool + { + return version_compare(app()->version(), '10.0', '>='); + } + public function setUp(): void { parent::setUp();