2
0
Эх сурвалжийг харах

[php] Re-enabled SPOD tests on PHP, and add test for #3598

Closes #3598
Cauê Waneck 10 жил өмнө
parent
commit
f8e269f90e

+ 3 - 2
std/sys/db/Manager.hx

@@ -242,7 +242,7 @@ class Manager<T : Object> {
 			var vc : Dynamic = Reflect.field(cache,name);
 			if( cache == null || v != vc ) {
 				switch( f.t ) {
-				case DSmallBinary, DNekoSerialized, DLongBinary, DBytes(_), DBinary: 
+				case DSmallBinary, DNekoSerialized, DLongBinary, DBytes(_), DBinary:
 					if ( !hasBinaryChanged(v,vc) )
 						continue;
 				case DData:
@@ -446,7 +446,8 @@ class Manager<T : Object> {
 			lock = true;
 			sql += getLockMode();
 		}
-		var r = unsafeExecute(sql).next();
+		var r = unsafeExecute(sql);
+		var r = r.hasNext() ? r.next() : null;
 		if( r == null )
 			return null;
 		normalizeCache(r);

+ 1 - 1
tests/RunCi.hx

@@ -505,7 +505,7 @@ class RunCi {
 					runCommand("neko", ["sys.n"].concat(args));
 				case Php:
 					getPhpDependencies();
-					runCommand("haxe", ["compile-php.hxml"]);
+					runCommand("haxe", ["compile-php.hxml","-D","travis"]);
 					runCommand("php", ["bin/php/index.php"]);
 				case Python:
 					var pys = getPythonDependencies();

+ 4 - 0
tests/unit/src/unit/TestSpod.hx

@@ -331,6 +331,10 @@ class TestSpod extends Test
 			c.delete();
 		for (c in OtherSpodClass.manager.all())
 			c.delete();
+
+		//issue #3598
+		var inexistent = MySpodClass.manager.get(1000,false);
+		eq(inexistent,null);
 	}
 
 	public function testDateQuery()