Derive mode from DSN function
- Add headers in all files - Minor field name changes
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user