@@ -568,7 +568,7 @@ public function testColumnsOnImplicitJoin()
568568
569569 public function testSpatialFilterWithin ()
570570 {
571- if (static ::$ config [ ' dbengine ' ]!= ' SQLite ' ) {
571+ if (static ::$ capabilities & self :: GIS ) {
572572 $ test = new API ($ this , static ::$ config );
573573 $ test ->get ('/users?columns=id,username&filter=location,swi,POINT(30 20) ' );
574574 $ test ->expect ('{"users":{"columns":["id","username"],"records":[[1,"user1"]]}} ' );
@@ -683,32 +683,52 @@ public function testListProductsProperties()
683683 {
684684 $ test = new API ($ this , static ::$ config );
685685 $ test ->get ('/products?columns=id,properties&transform=1 ' );
686- $ test ->expect ('{"products":[{"id":1,"properties":{"depth":false,"model":"TRX-120","width":100,"height":null}}]} ' );
686+ if (static ::$ capabilities & self ::JSON ) {
687+ $ test ->expect ('{"products":[{"id":1,"properties":{"depth":false,"model":"TRX-120","width":100,"height":null}}]} ' );
688+ } else {
689+ $ test ->expect ('{"products":[{"id":1,"properties":"{\"depth\":false,\"model\":\"TRX-120\",\"width\":100,\"height\":null}"}]} ' );
690+ }
687691 }
688692
689693 public function testReadProductProperties ()
690694 {
691695 $ test = new API ($ this , static ::$ config );
692696 $ test ->get ('/products/1?columns=id,properties ' );
693- $ test ->expect ('{"id":1,"properties":{"depth":false,"model":"TRX-120","width":100,"height":null}} ' );
697+ if (static ::$ capabilities & self ::JSON ) {
698+ $ test ->expect ('{"id":1,"properties":{"depth":false,"model":"TRX-120","width":100,"height":null}} ' );
699+ } else {
700+ $ test ->expect ('{"id":1,"properties":"{\"depth\":false,\"model\":\"TRX-120\",\"width\":100,\"height\":null}"} ' );
701+ }
694702 }
695703
696704 public function testWriteProductProperties ()
697705 {
698706 $ test = new API ($ this , static ::$ config );
699- $ test ->put ('/products/1 ' ,'{"properties":{"depth":false,"model":"TRX-120","width":100,"height":123}} ' );
707+ if (static ::$ capabilities & self ::JSON ) {
708+ $ test ->put ('/products/1 ' ,'{"properties":{"depth":false,"model":"TRX-120","width":100,"height":123}} ' );
709+ } else {
710+ $ test ->put ('/products/1 ' ,'{"properties":"{\"depth\":false,\"model\":\"TRX-120\",\"width\":100,\"height\":123}"} ' );
711+ }
700712 $ test ->expect ('1 ' );
701713 $ test ->get ('/products/1?columns=id,properties ' );
702- $ test ->expect ('{"id":1,"properties":{"depth":false,"model":"TRX-120","width":100,"height":123}} ' );
714+ if (static ::$ capabilities & self ::JSON ) {
715+ $ test ->expect ('{"id":1,"properties":{"depth":false,"model":"TRX-120","width":100,"height":123}} ' );
716+ } else {
717+ $ test ->expect ('{"id":1,"properties":"{\"depth\":false,\"model\":\"TRX-120\",\"width\":100,\"height\":123}"} ' );
718+ }
703719 }
704720
705721 public function testAddProducts ()
706722 {
707723 $ test = new API ($ this , static ::$ config );
708- $ test ->post ('/products ' ,'{"name":"Laptop","price":"1299.99","properties":{}} ' );
724+ if (static ::$ capabilities & self ::JSON ) {
725+ $ test ->post ('/products ' ,'{"name":"Laptop","price":"1299.99","properties":{}} ' );
726+ } else {
727+ $ test ->post ('/products ' ,'{"name":"Laptop","price":"1299.99","properties":"{}"} ' );
728+ }
709729 $ test ->expect ('2 ' );
710- $ test ->get ('/products/2 ' );
711- $ test ->expect ('{"id":2,"name":"Laptop","price":"1299.99","properties":{}," created_at":"2013-12-11 10:09:08","deleted_at":null} ' );
730+ $ test ->get ('/products/2?columns=id,created_at,deleted_at ' );
731+ $ test ->expect ('{"id":2,"created_at":"2013-12-11 10:09:08","deleted_at":null} ' );
712732 }
713733
714734 public function testSoftDeleteProducts ()
0 commit comments