You are here

protected function BlockContentIntegrationTest::assertIds in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/block_content/src/Tests/Views/BlockContentIntegrationTest.php \Drupal\block_content\Tests\Views\BlockContentIntegrationTest::assertIds()

Ensures that a list of block_contents appear on the page.

Parameters

array $expected_ids: An array of block_content IDs.

1 call to BlockContentIntegrationTest::assertIds()
BlockContentIntegrationTest::testBlockContentViewTypeArgument in core/modules/block_content/src/Tests/Views/BlockContentIntegrationTest.php
Tests basic block_content view with a block_content_type argument.

File

core/modules/block_content/src/Tests/Views/BlockContentIntegrationTest.php, line 63
Contains \Drupal\block_content\Tests\Views\BlockContentIntegrationTest.

Class

BlockContentIntegrationTest
Tests the block_content integration into views.

Namespace

Drupal\block_content\Tests\Views

Code

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