Skip to content

fix(ci): allow pest-plugin-livewire v3 for PHP 8.2 compatibility#17

Open
bajramemini wants to merge 4 commits intomainfrom
fix/php82-pest-livewire-compat
Open

fix(ci): allow pest-plugin-livewire v3 for PHP 8.2 compatibility#17
bajramemini wants to merge 4 commits intomainfrom
fix/php82-pest-livewire-compat

Conversation

@bajramemini
Copy link
Contributor

@bajramemini bajramemini commented Jan 28, 2026

Problem

CI is failing on PHP 8.2 due to two issues:

  1. pestphp/pest-plugin-livewire ^4.0 requires PHP ^8.3
  2. Intervention Image v3 moved the Laravel service provider class

Solution

Pest Plugin Fix

Allow both v3 and v4 of the plugin:

- "pestphp/pest-plugin-livewire": "^4.0"
+ "pestphp/pest-plugin-livewire": "^3.0|^4.0"

Intervention Image v3 Compatibility

  • Added intervention/image-laravel to require-dev for v3 support
  • Updated TestCase.php to detect and use the correct service provider:
    • v2: Intervention\Image\ImageServiceProvider
    • v3: Intervention\Image\Laravel\ServiceProvider

CI

This should fix the run-tests workflow for PHP 8.2.

bajramemini and others added 2 commits January 28, 2026 03:06
pest-plugin-livewire v4.0 requires PHP ^8.3, breaking CI for PHP 8.2.
This change allows v3.0 which supports PHP ^8.1 while still allowing
v4.0 for PHP 8.3+ environments.
- Add intervention/image-laravel for v3 Laravel service provider
- Update TestCase to detect and use correct service provider class
  - v2: Intervention\Image\ImageServiceProvider
  - v3: Intervention\Image\Laravel\ServiceProvider

This fixes the 'Class ImageServiceProvider not found' error in PHP 8.2 CI.
@bajramemini
Copy link
Contributor Author

CI Update

The TestCase service provider fix works (530 tests pass), but 5 tests in GenerateImageThumbnailTest.php fail because they use the v2 Intervention Image Facade directly:

use Intervention\Image\Facades\Image;
// ...
$img = Image::canvas(2000, 2000, '#ff0000');

In Intervention v3, this moved to Intervention\Image\Laravel\Facades\Image with API changes.

Two options:

  1. Quick fix: Pin to intervention/image ^2.7 only in composer.json
  2. Proper fix: Update the 5 tests to use v3 API

Let me know which direction you prefer and I can update the PR.

Bajram Emini added 2 commits January 30, 2026 03:01
Tests use v2 Facade API (Image::canvas, encode) which doesn't exist in v3.
Pin to ^2.7 only until tests are migrated to v3 API.

Removes intervention/image-laravel from require-dev as it's v3-only.
…ness

The test was using Faker-generated names which can contain special
characters (like apostrophes) that get HTML-escaped differently,
causing intermittent test failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant