Replaced template-level Vite conditionals with Laravel's official testing helper method, following Laravel 11 best practices. Changes: - Added withoutVite() to TestCase::setUp() (official Laravel method) - Reverted app.blade.php and guest.blade.php to use @vite normally - Removed unnecessary VITE_ENABLED env var from phpunit.xml - Templates now match production exactly (no testing conditionals) Benefits: ✅ Official Laravel best practice (confirmed via Laravel docs) ✅ Cleaner separation: templates unchanged, tests opt-out ✅ More flexible: can re-enable Vite per-test if needed ✅ Better for future browser/Dusk tests References: - https://laravel.com/docs/11.x/vite - https://codecourse.com/articles/disable-vite-during-laravel-tests Also documented Docker image strategy in DOCKER_IMAGES_EXPLAINED.md for future reference on CI/CD pipeline evolution.
21 lines
414 B
PHP
21 lines
414 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
/**
|
|
* Setup the test environment.
|
|
*/
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
// Disable Vite during tests (official Laravel best practice)
|
|
// Tests don't need compiled frontend assets
|
|
$this->withoutVite();
|
|
}
|
|
}
|