Skip to content

Modernize Contao driver (Contao 4.9+/5) - #5

Merged
Sandersm90 merged 4 commits into
masterfrom
fix/modernize-contao-driver
Oct 1, 2026
Merged

Sandersm90 merged 4 commits into
masterfrom
fix/modernize-contao-driver

Conversation

@Sandersm90

Copy link
Copy Markdown

Stacked on #4.

Replaces the fork's legacy Contao 3/4 driver (vendor/contao + web/app.php) with the upstream laravel/valet implementation:

  • Auto-detects the front-controller directory (web vs public).
  • Uses index.php as the front controller and routes contao-manager.phar.php and preview.php.
  • Re-enables the two ContaoValetDriverTest methods that were skipped in Port framework-driver test suite from upstream #4 while the fork shipped the legacy driver.

Full suite: 305 tests, 0 skipped. phpstan green, php-cs-fixer clean.

- Add phpstan/phpstan-mockery so Mockery-based test doubles are understood.
- Generate phpstan-baseline.neon capturing the 593 pre-existing level-9 errors
  so the analysis exits clean and flags only new regressions; the baseline is
  the burn-down backlog.
- Add composer scripts (test, stan, cs, cs:fix); stan bakes in --memory-limit=1G
  to avoid the default 128M OOM.
The fork had zero driver tests. Adopt upstream's suite (platform-agnostic,
same Valet\Drivers namespace):

- Add tests/Drivers/ (BaseDriverTestCase + 23 driver tests) and the
  tests/Drivers/projects + tests/files fixtures. Base case namespaced
  Valet\Tests\Drivers, extends PHPUnit TestCase directly (no container boot),
  setUp() instead of the Yoast polyfill's set_up(), projects provider via
  plain scandir().
- Add NetteValetDriver (upstream drop-in) so the driver set matches upstream;
  auto-discovered by the specific-driver path scan.
- Two ContaoValetDriverTest methods are marked skipped: the fork still ships
  the legacy Contao 3/4 driver while the upstream fixture is modern Contao;
  re-enable after modernizing the driver (.review U6).
- Refresh phpstan-baseline.neon to absorb the new test files' level-9 errors
  (burn-down backlog); analysis stays green.

Full suite: 305 tests, 2 skipped. php-cs-fixer clean.
The repo's .gitignore excludes bin/ and vendor/, which also matched three
driver-suite fixtures, so they were never committed:
- tests/Drivers/projects/cake/bin/cake
- tests/Drivers/projects/magento2/bin/magento
- tests/Drivers/projects/contao/vendor/contao/.gitkeep

Force-add them so CakeValetDriverTest / Magento2ValetDriverTest (and the
Contao test once modernized) see their fixtures on a fresh checkout. Caught
by CI (passed locally only because the Docker mount included ignored files).
Replace the legacy Contao 3/4 driver (vendor/contao + web/app.php) with the
upstream laravel/valet implementation:

- Auto-detect the front-controller directory (web vs public).
- Use index.php as the front controller and route contao-manager.phar.php
  and preview.php.
- Re-enable the two ContaoValetDriverTest methods that were skipped while the
  fork shipped the legacy driver.

Full suite: 305 tests, 0 skipped. Baseline refreshed; phpstan green.
@Sandersm90
Sandersm90 force-pushed the fix/modernize-contao-driver branch from f16419b to c671aef Compare October 1, 2026 12:10
@Sandersm90
Sandersm90 changed the base branch from test/port-driver-suite to master October 1, 2026 12:54
@Sandersm90
Sandersm90 merged commit c614003 into master Oct 1, 2026
5 checks passed
@Sandersm90
Sandersm90 deleted the fix/modernize-contao-driver branch October 1, 2026 12:56
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