Set up end-to-end browser testing using Pest Browser Plugin + Playwright. New v4 test suite uses SQLite :memory: database with pre-generated schema dump (database/schema/testing-schema.sql) instead of running migrations, enabling faster test startup. - Add pestphp/pest-plugin-browser dependency - Create GenerateTestingSchema command to export PostgreSQL schema to SQLite - Add .env.testing configuration for isolated test environment - Implement v4 test directory structure (Feature, Browser, Unit tests) - Update Pest skill documentation with browser testing patterns, API reference, debugging techniques, and common pitfalls - Configure phpunit.xml and tests/Pest.php for v4 suite - Update package.json and docker-compose.dev.yml for testing dependencies
18 lines
542 B
PHP
18 lines
542 B
PHP
<?php
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
it('uses sqlite for testing', function () {
|
|
expect(DB::connection()->getDriverName())->toBe('sqlite');
|
|
});
|
|
|
|
it('runs migrations successfully', function () {
|
|
expect(Schema::hasTable('users'))->toBeTrue();
|
|
expect(Schema::hasTable('teams'))->toBeTrue();
|
|
expect(Schema::hasTable('servers'))->toBeTrue();
|
|
expect(Schema::hasTable('applications'))->toBeTrue();
|
|
});
|