Skip to content

Commit

Permalink
Capability fix for sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
mevdschee committed Apr 15, 2017
1 parent fb75a38 commit b58f4ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/SqliteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function checkVersion($db)
public function getCapabilities($db)
{
$capabilities = 0;
$capabilities |= self::JSON;
return $capabilities;
}

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

if (!($capabilities & self::GIS)) {
$contents = preg_replace('/GEOMETRY NOT NULL/i','text NOT NULL',$contents);
}
if (!($capabilities & self::JSON)) {
$contents = preg_replace('/JSON NOT NULL/i','text NOT NULL',$contents);
}

$queries = preg_split('/;\s*\n/', $contents);
array_pop($queries);

Expand Down

0 comments on commit b58f4ed

Please sign in to comment.