Switch to in-memory db for polyfill test.

This commit is contained in:
flash 2024-10-21 18:15:09 +00:00
parent 2f577d97cc
commit 40cbd35ba3

View file

@ -15,7 +15,7 @@ use Index\Db\Sqlite\{SqliteConnection,SqliteConnectionInfo,SqliteMariaDbPolyfill
final class SqliteMariaDbPolyfillTest extends TestCase { final class SqliteMariaDbPolyfillTest extends TestCase {
public function testSqliteMariaDbPolyfill(): void { public function testSqliteMariaDbPolyfill(): void {
$dbPath = tempnam(sys_get_temp_dir(), 'ndx'); $dbPath = tempnam(sys_get_temp_dir(), 'ndx');
$db = new SqliteConnection(SqliteConnectionInfo::createTemp()); $db = new SqliteConnection(SqliteConnectionInfo::createMemory());
SqliteMariaDbPolyfill::apply($db); SqliteMariaDbPolyfill::apply($db);
$result = $db->query('SELECT IF(1, "true", "false"), IF(0, "true", "false"), IF(NULL, "true", "false"), IF("beans", "true", "false")'); $result = $db->query('SELECT IF(1, "true", "false"), IF(0, "true", "false"), IF(NULL, "true", "false"), IF("beans", "true", "false")');