@@ -357,6 +357,20 @@ public function testListWithPaginateLastPage()
357357 $ test ->expect ('{"posts":{"columns":["id","user_id","category_id","content"],"records":[[14,1,1,"#10"]],"results":11}} ' );
358358 }
359359
360+ public function testListExampleFromReadmeFullRecord ()
361+ {
362+ $ test = new API ($ this );
363+ $ test ->get ('/posts?filter=id,eq,1 ' );
364+ $ test ->expect ('{"posts":{"columns":["id","user_id","category_id","content"],"records":[[1,1,1,"blog started"]]}} ' );
365+ }
366+
367+ public function testListExampleFromReadmeWithExclude ()
368+ {
369+ $ test = new API ($ this );
370+ $ test ->get ('/posts?exclude=id&filter=id,eq,1 ' );
371+ $ test ->expect ('{"posts":{"columns":["user_id","category_id","content"],"records":[[1,1,"blog started"]]}} ' );
372+ }
373+
360374 public function testListExampleFromReadme ()
361375 {
362376 $ test = new API ($ this );
@@ -371,6 +385,13 @@ public function testListExampleFromReadmeWithTransform()
371385 $ test ->expect ('{"posts":[{"id":1,"post_tags":[{"id":1,"post_id":1,"tag_id":1,"tags":[{"id":1,"name":"funny"}]},{"id":2,"post_id":1,"tag_id":2,"tags":[{"id":2,"name":"important"}]}],"comments":[{"id":1,"post_id":1,"message":"great"},{"id":2,"post_id":1,"message":"fantastic"}],"user_id":1,"category_id":1,"categories":[{"id":1,"name":"announcement","icon":null}],"content":"blog started"}]} ' );
372386 }
373387
388+ public function testListExampleFromReadmeWithTransformWithExclude ()
389+ {
390+ $ test = new API ($ this );
391+ $ test ->get ('/posts?include=categories,tags,comments&exclude=comments.message&filter=id,eq,1&transform=1 ' );
392+ $ test ->expect ('{"posts":[{"id":1,"post_tags":[{"id":1,"post_id":1,"tag_id":1,"tags":[{"id":1,"name":"funny"}]},{"id":2,"post_id":1,"tag_id":2,"tags":[{"id":2,"name":"important"}]}],"comments":[{"id":1,"post_id":1},{"id":2,"post_id":1}],"user_id":1,"category_id":1,"categories":[{"id":1,"name":"announcement","icon":null}],"content":"blog started"}]} ' );
393+ }
394+
374395 public function testEditCategoryWithBinaryContent ()
375396 {
376397 $ binary = base64_encode ("\0abc \0\n\r\b \0" );
@@ -429,7 +450,7 @@ public function testOptionsRequest()
429450 {
430451 $ test = new API ($ this );
431452 $ test ->options ('/posts/2 ' );
432- $ test ->expect ('["Access-Control-Allow-Headers: Content-Type","Access-Control-Allow-Methods: OPTIONS, GET, PUT, POST, DELETE, PATCH","Access-Control-Allow-Credentials: true","Access-Control-Max-Age: 1728000"] ' ,false );
453+ $ test ->expect ('["Access-Control-Allow-Headers: Content-Type, X-XSRF-Token ","Access-Control-Allow-Methods: OPTIONS, GET, PUT, POST, DELETE, PATCH","Access-Control-Allow-Credentials: true","Access-Control-Max-Age: 1728000"] ' ,false );
433454 }
434455
435456 public function testHidingPasswordColumn ()
0 commit comments