private function checkCategoriesList($response)
{
$this->assertResponseDataHasKeys(['id', 'name' => $this->matchesRegularExpression('/^' . RoleCategory::NAME_REGEXP . '$/')], $response, true, 'data');
foreach ($response['data'] as $category) {
if ($category['name'] == $this->testCategoryName || $category['name'] == $this->invalidCategoryName) {
$this->request('/roles/categories/xGroupActionHandler', ['ids' => json_encode([$category['id']])], 'POST');
}
}
}