@@ -357,6 +357,20 @@ public function testListWithPaginateLastPage()
357
357
$ test ->expect ('{"posts":{"columns":["id","user_id","category_id","content"],"records":[[14,1,1,"#10"]],"results":11}} ' );
358
358
}
359
359
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
+
360
374
public function testListExampleFromReadme ()
361
375
{
362
376
$ test = new API ($ this );
@@ -371,6 +385,13 @@ public function testListExampleFromReadmeWithTransform()
371
385
$ 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"}]} ' );
372
386
}
373
387
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
+
374
395
public function testEditCategoryWithBinaryContent ()
375
396
{
376
397
$ binary = base64_encode ("\0abc \0\n\r\b \0" );
@@ -429,7 +450,7 @@ public function testOptionsRequest()
429
450
{
430
451
$ test = new API ($ this );
431
452
$ 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 );
433
454
}
434
455
435
456
public function testHidingPasswordColumn ()
0 commit comments