|
@@ -329,14 +329,14 @@ class PHP_CRUD_API_Test extends PHPUnit_Framework_TestCase
|
329
|
329
|
{
|
330
|
330
|
$test = new API($this);
|
331
|
331
|
$test->get('/posts?include=categories,tags,comments&filter=id,eq,1');
|
332
|
|
- $test->expect('{"posts":{"columns":["id","user_id","category_id","content"],"records":[["1","1","1","blog started"]]},"post_tags":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","tag_id"],"records":[["1","1","1"],["2","1","2"]]},"categories":{"relations":{"id":"posts.category_id"},"columns":["id","name","icon"],"records":[["1","anouncement",null]]},"tags":{"relations":{"id":"post_tags.tag_id"},"columns":["id","name"],"records":[["1","funny"],["2","important"]]},"comments":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","message"],"records":[["1","1","great"],["2","1","fantastic"]]}}');
|
|
332
|
+ $test->expect('{"posts":{"columns":["id","user_id","category_id","content"],"records":[["1","1","1","blog started"]]},"post_tags":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","tag_id"],"records":[["1","1","1"],["2","1","2"]]},"categories":{"relations":{"id":"posts.category_id"},"columns":["id","name","icon"],"records":[["1","announcement",null]]},"tags":{"relations":{"id":"post_tags.tag_id"},"columns":["id","name"],"records":[["1","funny"],["2","important"]]},"comments":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","message"],"records":[["1","1","great"],["2","1","fantastic"]]}}');
|
333
|
333
|
}
|
334
|
334
|
|
335
|
335
|
public function testListExampleFromReadmeWithTransform()
|
336
|
336
|
{
|
337
|
337
|
$test = new API($this);
|
338
|
338
|
$test->get('/posts?include=categories,tags,comments&filter=id,eq,1&transform=1');
|
339
|
|
- $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":"anouncement","icon":null}],"content":"blog started"}]}');
|
|
339
|
+ $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"}]}');
|
340
|
340
|
}
|
341
|
341
|
|
342
|
342
|
public function testEditCategoryWithBinaryContent()
|
|
@@ -487,7 +487,7 @@ class PHP_CRUD_API_Test extends PHPUnit_Framework_TestCase
|
487
|
487
|
{
|
488
|
488
|
$test = new API($this);
|
489
|
489
|
$test->get('/categories?filter[]=icon,is,null&transform=1');
|
490
|
|
- $test->expect('{"categories":[{"id":"1","name":"anouncement","icon":null},{"id":"2","name":"alert();","icon":null}]}');
|
|
490
|
+ $test->expect('{"categories":[{"id":"1","name":"announcement","icon":null},{"id":"2","name":"alert();","icon":null}]}');
|
491
|
491
|
}
|
492
|
492
|
|
493
|
493
|
public function testFilterCategoryOnNotNullIcon()
|
|
@@ -522,7 +522,7 @@ class PHP_CRUD_API_Test extends PHPUnit_Framework_TestCase
|
522
|
522
|
{
|
523
|
523
|
$test = new API($this);
|
524
|
524
|
$test->get('/posts?include=categories&columns=categories.name&filter=id,eq,1&transform=1');
|
525
|
|
- $test->expect('{"posts":[{"category_id":"1","categories":[{"id":"1","name":"anouncement"}]}]}');
|
|
525
|
+ $test->expect('{"posts":[{"category_id":"1","categories":[{"id":"1","name":"announcement"}]}]}');
|
526
|
526
|
}
|
527
|
527
|
|
528
|
528
|
public function testColumnsOnWrongInclude()
|