37 lines
975 B
PHP
37 lines
975 B
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use Tests\TestCase;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
class FastDatabaseTest extends TestCase
|
|
{
|
|
// Note: NOT using RefreshDatabase to avoid migration overhead
|
|
|
|
/**
|
|
* Test database operations without full migration
|
|
*/
|
|
public function test_database_basic_operations()
|
|
{
|
|
// Test configuration is working
|
|
$this->assertIsString(config('database.default'));
|
|
$this->assertEquals('sqlite', config('database.connections.testing.driver') ?? config('database.connections.sqlite.driver'));
|
|
}
|
|
|
|
/**
|
|
* Test we can connect to test database
|
|
*/
|
|
public function test_test_database_connection()
|
|
{
|
|
try {
|
|
\DB::connection()->getPdo();
|
|
$connected = true;
|
|
} catch (\Exception $e) {
|
|
$connected = false;
|
|
}
|
|
|
|
$this->assertTrue($connected, 'Should be able to connect to test database');
|
|
}
|
|
}
|