These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace League\Fractal\Test\Pagination; |
||
4 | |||
5 | use League\Fractal\Pagination\PhalconFrameworkPaginatorAdapter; |
||
6 | use PHPUnit\Framework\TestCase; |
||
7 | |||
8 | class PhalconFrameworkPaginatorAdapterTest extends TestCase |
||
9 | { |
||
10 | public function testPaginationAdapter() |
||
11 | { |
||
12 | $resultset = new \stdClass(); |
||
13 | $resultset->items = array_fill(1, 10, 'fractal'); |
||
14 | $resultset->current = 3; |
||
15 | $resultset->first = 1; |
||
16 | $resultset->last = 5; |
||
17 | $resultset->next = 4; |
||
18 | $resultset->previous = 2; |
||
19 | $resultset->total_items = 50; |
||
20 | $resultset->total_pages = 10; |
||
21 | |||
22 | $adapter = new PhalconFrameworkPaginatorAdapter($resultset); |
||
0 ignored issues
–
show
|
|||
23 | $this->assertInstanceOf('League\Fractal\Pagination\PaginatorInterface', $adapter); |
||
24 | $this->assertSame(3, $adapter->getCurrentPage()); |
||
25 | $this->assertSame(10, $adapter->getCount()); |
||
26 | $this->assertSame(50, $adapter->getTotal()); |
||
27 | $this->assertSame(10, $adapter->getPerPage()); |
||
28 | $this->assertSame(5, $adapter->getLastPage()); |
||
29 | $this->assertSame(4, $adapter->getNext()); |
||
30 | } |
||
31 | } |
||
32 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: