Skip to content

Commit 1f74ccf

Browse files
authored
Add a self link to the paginated collection example (#102)
1 parent 5a68321 commit 1f74ccf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/PaginationTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use JsonApiPhp\JsonApi\Link\LastLink;
1111
use JsonApiPhp\JsonApi\Link\NextLink;
1212
use JsonApiPhp\JsonApi\Link\PrevLink;
13+
use JsonApiPhp\JsonApi\Link\SelfLink;
1314
use JsonApiPhp\JsonApi\PaginatedCollection;
1415
use JsonApiPhp\JsonApi\Pagination;
1516
use JsonApiPhp\JsonApi\ResourceCollection;
@@ -33,7 +34,8 @@ public function testPaginatedResourceCollection()
3334
"first": "http://example.com/fruits?page=first",
3435
"last": "http://example.com/fruits?page=last",
3536
"prev": "http://example.com/fruits?page=3",
36-
"next": "http://example.com/fruits?page=5"
37+
"next": "http://example.com/fruits?page=5",
38+
"self": "http://example.com/fruits?page=4"
3739
}
3840
}
3941
',
@@ -49,7 +51,8 @@ public function testPaginatedResourceCollection()
4951
new ResourceObject('apples', '1'),
5052
new ResourceObject('apples', '2')
5153
)
52-
)
54+
),
55+
new SelfLink('http://example.com/fruits?page=4')
5356
)
5457
);
5558
}

0 commit comments

Comments
 (0)