Refactor core test runtime and simplify project documentation

This commit is contained in:
julien
2026-03-20 22:52:02 +01:00
parent 9b1dd9417c
commit 24b3bb4177
19 changed files with 266 additions and 132 deletions

View File

@@ -5,14 +5,15 @@ declare(strict_types=1);
namespace Tests\Kernel;
use Netig\Netslim\Kernel\Persistence\Infrastructure\Provisioner;
use PDO;
use PHPUnit\Framework\TestCase;
use Tests\Support\TestDatabaseFactory;
use Tests\Support\TestRuntimeFactory;
#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations]
final class ProvisionerTest extends TestCase
{
private PDO $db;
private \PDO $db;
private string $lockPath;
@@ -20,13 +21,11 @@ final class ProvisionerTest extends TestCase
protected function setUp(): void
{
$this->db = new PDO('sqlite::memory:', options: [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
]);
TestRuntimeFactory::resetRuntime();
$this->db = TestDatabaseFactory::createInMemory();
$this->db->sqliteCreateFunction('strip_tags', 'strip_tags', 1);
$this->lockPath = dirname(__DIR__, 2) . '/database/.provision.lock';
$this->lockPath = TestRuntimeFactory::path('database/.provision.lock');
@unlink($this->lockPath);
$this->envBackup = [