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,4 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* @author Daniel J. Summers <daniel@bitbadger.solutions>
* @license MIT
*/
declare(strict_types=1);
namespace Test\Unit\Mapper;
@@ -17,10 +23,10 @@ class ExistsMapperTest extends TestCase
public function testMapSucceedsForPostgreSQL(): void
{
try {
Configuration::$mode = Mode::PgSQL;
Configuration::overrideMode(Mode::PgSQL);
$this->assertFalse((new ExistsMapper())->map([false, 'nope']), 'Result should have been false');
} finally {
Configuration::$mode = null;
Configuration::overrideMode(null);
}
}
@@ -28,17 +34,17 @@ class ExistsMapperTest extends TestCase
public function testMapSucceedsForSQLite(): void
{
try {
Configuration::$mode = Mode::SQLite;
Configuration::overrideMode(Mode::SQLite);
$this->assertTrue((new ExistsMapper())->map([1, 'yep']), 'Result should have been true');
} finally {
Configuration::$mode = null;
Configuration::overrideMode(null);
}
}
public function testMapFailsWhenModeNotSet(): void
{
$this->expectException(DocumentException::class);
Configuration::$mode = null;
Configuration::overrideMode(null);
(new ExistsMapper())->map(['0']);
}
}