You are here

public function BasicTest::testSimpleResultSet in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Tests/BasicTest.php \Drupal\views\Tests\BasicTest::testSimpleResultSet()

Tests a trivial result set.

File

core/modules/views/src/Tests/BasicTest.php, line 29
Contains \Drupal\views\Tests\BasicTest.

Class

BasicTest
A basic query test for Views.

Namespace

Drupal\views\Tests

Code

public function testSimpleResultSet() {
  $view = Views::getView('test_view');
  $view
    ->setDisplay();

  // Execute the view.
  $this
    ->executeView($view);

  // Verify the result.
  $this
    ->assertEqual(5, count($view->result), 'The number of returned rows match.');
  $this
    ->assertIdenticalResultset($view, $this
    ->dataSet(), array(
    'views_test_data_name' => 'name',
    'views_test_data_age' => 'age',
  ));
}