$values['status'
] = FALSE;
$values['title'
] =
$this->
randomMachineName();
$node =
$this->nodeStorage->
create($values);
$node->
save();
$not_expected_nids[] =
$node->
id();
$column_map =
['nid' => 'nid'
];
$view->
setDisplay('page_1'
);
$this->
executeView($view);
$this->
assertIdenticalResultset($view,
array_slice($expected, 0, 10
),
$column_map, 'Ensure that the right nodes are displayed on the frontpage.'
);
$this->
assertNotInResultSet($view,
$not_expected_nids, 'Ensure no unexpected node is in the result.'
);
$view->
destroy();
$view->
setDisplay('page_1'
);
$view->
setCurrentPage(1
);
$this->
executeView($view);
$this->
assertIdenticalResultset($view,
array_slice($expected, 10, 10
),
$column_map, 'Ensure that the right nodes are displayed on second page of the frontpage.'
);
$this->
assertNotInResultSet($view,
$not_expected_nids, 'Ensure no unexpected node is in the result.'
);
$view->
destroy();
} /**
* Verifies that an amount of nids aren't in the result.
*
* @param \Drupal\views\ViewExecutable $view
* An executed View.
* @param array $not_expected_nids
* An array of nids which should not be part of the resultset.
* @param string $message
* (optional) A custom message to display with the assertion.
*
* @internal
*/