function BasicTest::testSimpleResultSet

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/BasicTest.php \Drupal\Tests\views\Kernel\BasicTest::testSimpleResultSet()
  2. 8.9.x core/modules/views/tests/src/Kernel/BasicTest.php \Drupal\Tests\views\Kernel\BasicTest::testSimpleResultSet()
  3. 11.x core/modules/views/tests/src/Kernel/BasicTest.php \Drupal\Tests\views\Kernel\BasicTest::testSimpleResultSet()

Tests a trivial result set.

File

core/modules/views/tests/src/Kernel/BasicTest.php, line 26

Class

BasicTest
A basic query test for Views.

Namespace

Drupal\Tests\views\Kernel

Code

public function testSimpleResultSet() : void {
    $view = Views::getView('test_view');
    $view->setDisplay();
    // Execute the view.
    $this->executeView($view);
    // Verify the result.
    $this->assertCount(5, $view->result, 'The number of returned rows match.');
    $this->assertIdenticalResultset($view, $this->dataSet(), [
        'views_test_data_name' => 'name',
        'views_test_data_age' => 'age',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.