You are here

protected function NodeIntegrationTest::assertNids in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/Views/NodeIntegrationTest.php \Drupal\node\Tests\Views\NodeIntegrationTest::assertNids()

Ensures that a list of nodes appear on the page.

Parameters

array $expected_nids: An array of node IDs.

1 call to NodeIntegrationTest::assertNids()
NodeIntegrationTest::testNodeViewTypeArgument in core/modules/node/src/Tests/Views/NodeIntegrationTest.php
Tests basic node view with a node type argument.

File

core/modules/node/src/Tests/Views/NodeIntegrationTest.php, line 63
Contains \Drupal\node\Tests\Views\NodeIntegrationTest.

Class

NodeIntegrationTest
Tests the node integration into views.

Namespace

Drupal\node\Tests\Views

Code

protected function assertNids(array $expected_nids = array()) {
  $result = $this
    ->xpath('//span[@class="field-content"]');
  $nids = array();
  foreach ($result as $element) {
    $nids[] = (int) $element;
  }
  $this
    ->assertEqual($nids, $expected_nids);
}