Browse Source

bugfix for postgis detection

Maurits van der Schee 7 years ago
parent
commit
73e2d88e6e
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      tests/MysqlTest.php
  2. 1
    1
      tests/PostgresqlTest.php

+ 1
- 1
tests/MysqlTest.php View File

92
         $contents = file_get_contents($fixture);
92
         $contents = file_get_contents($fixture);
93
 
93
 
94
         if (!($capabilities & self::GIS)) {
94
         if (!($capabilities & self::GIS)) {
95
-            $contents = preg_replace('/(POINT|POLYGON) NOT NULL/i', 'text NOT NULL', $contents);
95
+            $contents = preg_replace('/(POINT|POLYGON)( NOT)? NULL/i', 'text\2 NULL', $contents);
96
             $contents = preg_replace('/ST_GeomFromText/i', 'concat', $contents);
96
             $contents = preg_replace('/ST_GeomFromText/i', 'concat', $contents);
97
         }
97
         }
98
         if (!($capabilities & self::JSON)) {
98
         if (!($capabilities & self::JSON)) {

+ 1
- 1
tests/PostgresqlTest.php View File

93
         $contents = file_get_contents($fixture);
93
         $contents = file_get_contents($fixture);
94
 
94
 
95
         if (!($capabilities & self::GIS)) {
95
         if (!($capabilities & self::GIS)) {
96
-            $contents = preg_replace('/(geometry) NOT NULL/i', 'text NOT NULL', $contents);
96
+            $contents = preg_replace('/(geometry)( NOT)? NULL/i', 'text\2 NULL', $contents);
97
             $contents = preg_replace('/ST_GeomFromText/i', 'concat', $contents);
97
             $contents = preg_replace('/ST_GeomFromText/i', 'concat', $contents);
98
             $contents = preg_replace('/CREATE EXTENSION IF NOT EXISTS postgis;/i', '', $contents);
98
             $contents = preg_replace('/CREATE EXTENSION IF NOT EXISTS postgis;/i', '', $contents);
99
         }
99
         }

Loading…
Cancel
Save