function ViewResultAssertionTrait::assertIdenticalResultset
Same name and namespace in other branches
- 11.x core/modules/views/src/Tests/ViewResultAssertionTrait.php \Drupal\views\Tests\ViewResultAssertionTrait::assertIdenticalResultset()
- 10 core/modules/views/src/Tests/ViewResultAssertionTrait.php \Drupal\views\Tests\ViewResultAssertionTrait::assertIdenticalResultset()
- 8.9.x core/modules/views/src/Tests/ViewResultAssertionTrait.php \Drupal\views\Tests\ViewResultAssertionTrait::assertIdenticalResultset()
Verifies that a result set returned by a View matches expected values.
The comparison is done on the string representation of the columns of the column map, taking the order of the rows into account, but not the order of the columns.
Parameters
\Drupal\views\ViewExecutable $view: An executed View.
array $expected_result: An expected result set.
array $column_map: (optional) An associative array mapping the columns of the result set from the view (as keys) and the expected result set (as values).
string $message: (optional) A custom message to display with the assertion. Defaults to 'Identical result set.'
3 calls to ViewResultAssertionTrait::assertIdenticalResultset()
- FilterLanguageTest::testFilter in core/
modules/ language/ tests/ src/ Kernel/ Views/ FilterLanguageTest.php - Tests the language filter.
- RelationshipUserImageDataTest::testViewsHandlerRelationshipUserImageData in core/
modules/ image/ tests/ src/ Kernel/ Views/ RelationshipUserImageDataTest.php - Tests using the views image relationship.
- WorkspaceIntegrationTest::assertWorkspaceStatus in core/
modules/ workspaces/ tests/ src/ Kernel/ WorkspaceIntegrationTest.php - Checks entity load, entity queries and views results for a test scenario.
File
-
core/
modules/ views/ src/ Tests/ ViewResultAssertionTrait.php, line 31
Class
- ViewResultAssertionTrait
- Provides a class for assertions to check for the expected result of a View.
Namespace
Drupal\views\TestsCode
protected function assertIdenticalResultset($view, $expected_result, $column_map = [], $message = NULL) : void {
$this->assertIdenticalResultsetHelper($view, $expected_result, $column_map, 'assertIdentical', $message);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.