Derive mode from DSN function

- Add headers in all files
- Minor field name changes
This commit is contained in:
2024-07-20 21:47:21 -04:00
parent 1a37b009ea
commit d8330d828a
81 changed files with 1053 additions and 551 deletions

View File

@@ -1,8 +1,15 @@
<?php
/**
* @author Daniel J. Summers <daniel@bitbadger.solutions>
* @license MIT
* @see https://github.com/Zaid-Ajaj/ThrowawayDb The origin concept
*/
declare(strict_types=1);
namespace Test\Integration\SQLite;
use BitBadger\PDODocument\{AutoId, Configuration, Definition, Document, DocumentException, Mode};
use BitBadger\PDODocument\{AutoId, Configuration, Definition, Document, DocumentException};
use Random\RandomException;
use Test\Integration\{SubDocument, TestDocument};
@@ -12,7 +19,7 @@ use Test\Integration\{SubDocument, TestDocument};
class ThrowawayDb
{
/** @var string The table used for document manipulation */
public const TABLE = "test_table";
public const TABLE = 'test_table';
/**
* Create a throwaway SQLite database
@@ -24,8 +31,7 @@ class ThrowawayDb
public static function create(bool $withData = true): string
{
$fileName = sprintf('throwaway-%s.db', AutoId::generateRandom(10));
Configuration::$pdoDSN = "sqlite:./$fileName";
Configuration::$mode = Mode::SQLite;
Configuration::useDSN("sqlite:./$fileName");
Configuration::resetPDO();
if ($withData) {