assertTrue( class_exists(Neuron::class), 'MISSING AUTOLOAD: autoload.php did not resolve Libs\Neuron; check ROOT_CORE and run from the project root' ); $neuron = new Neuron(['key' => 'value']); $this->assertSame('value', $neuron->key); $this->assertNull($neuron->doesNotExist); } #[Test] public function databaseConstantsPointToInMemorySqlite(): void { $this->assertSame( 'sqlite', DB_TYPE, 'MISSING OVERRIDE: DB_TYPE comes from config.php; the bootstrap must define the DB_* constants BEFORE requiring autoload.php' ); $this->assertSame(':memory:', DB_NAME, 'DB_NAME should be :memory: so tests never touch disks or servers'); } #[Test] public function testDatabaseIsUsable(): void { $db = self::db(); $this->assertInstanceOf(PDO::class, $db, 'Could not obtain the test PDO connection'); $this->assertSame($db, self::db(), 'Database::getInstance should return the same singleton'); $db->exec('CREATE TABLE smoke (id INTEGER PRIMARY KEY, v TEXT)'); $db->prepare('INSERT INTO smoke (v) VALUES (?)')->execute(['quack']); $this->assertSame('quack', $db->query('SELECT v FROM smoke')->fetchColumn()); $db->exec('DROP TABLE smoke'); } }