static::
assertEquals('c',
$content['data'
][2
]['attributes'
]['link'
]);
} /**
* PAGING
*/
public function testPage(): void
{ $link = 'testPage';
$limit = 10;
$pageCount = 2;
$ids =
$this->
createData($link,
$limit *
$pageCount);
$requestedPage = 2;
$this->
getBrowser()->
request('GET',
$this->url . '/product-manufacturer',
['page' =>
$requestedPage, 'limit' =>
$limit, 'filter' =>
['product_manufacturer.link' =>
$link], 'sort' => 'product_manufacturer.id'
]);
static::
assertSame(200,
$this->
getBrowser()->
getResponse()->
getStatusCode());
$content =
json_decode($this->
getBrowser()->
getResponse()->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
$expectedIds = \
array_slice($ids,
$limit *
($requestedPage - 1
),
$limit);
$actualIds =
array_column($content['data'
], 'id'
);
static::
assertEquals($expectedIds,
$actualIds);
}