@@ -568,7 +568,7 @@ public function testColumnsOnImplicitJoin()
568
568
569
569
public function testSpatialFilterWithin ()
570
570
{
571
- if (static ::$ config [ ' dbengine ' ]!= ' SQLite ' ) {
571
+ if (static ::$ capabilities & self :: GIS ) {
572
572
$ test = new API ($ this , static ::$ config );
573
573
$ test ->get ('/users?columns=id,username&filter=location,swi,POINT(30 20) ' );
574
574
$ test ->expect ('{"users":{"columns":["id","username"],"records":[[1,"user1"]]}} ' );
@@ -683,32 +683,52 @@ public function testListProductsProperties()
683
683
{
684
684
$ test = new API ($ this , static ::$ config );
685
685
$ 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
+ }
687
691
}
688
692
689
693
public function testReadProductProperties ()
690
694
{
691
695
$ test = new API ($ this , static ::$ config );
692
696
$ 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
+ }
694
702
}
695
703
696
704
public function testWriteProductProperties ()
697
705
{
698
706
$ 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
+ }
700
712
$ test ->expect ('1 ' );
701
713
$ 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
+ }
703
719
}
704
720
705
721
public function testAddProducts ()
706
722
{
707
723
$ 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
+ }
709
729
$ 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} ' );
712
732
}
713
733
714
734
public function testSoftDeleteProducts ()
0 commit comments