Skip to content

Commit b58f4ed

Browse files
committed
Capability fix for sqlite
1 parent fb75a38 commit b58f4ed

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/SqliteTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function checkVersion($db)
5454
public function getCapabilities($db)
5555
{
5656
$capabilities = 0;
57-
$capabilities |= self::JSON;
5857
return $capabilities;
5958
}
6059

@@ -68,6 +67,13 @@ public function seedDatabase($db, $capabilities)
6867
$fixture = __DIR__.'/data/blog_sqlite.sql';
6968
$contents = file_get_contents($fixture);
7069

70+
if (!($capabilities & self::GIS)) {
71+
$contents = preg_replace('/GEOMETRY NOT NULL/i','text NOT NULL',$contents);
72+
}
73+
if (!($capabilities & self::JSON)) {
74+
$contents = preg_replace('/JSON NOT NULL/i','text NOT NULL',$contents);
75+
}
76+
7177
$queries = preg_split('/;\s*\n/', $contents);
7278
array_pop($queries);
7379

0 commit comments

Comments
 (0)