Browse Source

Capability fix for sqlite

Maurits van der Schee 7 years ago
parent
commit
b58f4ed8f5
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      tests/SqliteTest.php

+ 7
- 1
tests/SqliteTest.php View File

54
     public function getCapabilities($db)
54
     public function getCapabilities($db)
55
     {
55
     {
56
         $capabilities = 0;
56
         $capabilities = 0;
57
-        $capabilities |= self::JSON;
58
         return $capabilities;
57
         return $capabilities;
59
     }
58
     }
60
 
59
 
68
         $fixture = __DIR__.'/data/blog_sqlite.sql';
67
         $fixture = __DIR__.'/data/blog_sqlite.sql';
69
         $contents = file_get_contents($fixture);
68
         $contents = file_get_contents($fixture);
70
 
69
 
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
+
71
         $queries = preg_split('/;\s*\n/', $contents);
77
         $queries = preg_split('/;\s*\n/', $contents);
72
         array_pop($queries);
78
         array_pop($queries);
73
 
79
 

Loading…
Cancel
Save