You are here

protected function FieldWebTest::clickSortLoadIdsFromOutput in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Handler/FieldWebTest.php \Drupal\views\Tests\Handler\FieldWebTest::clickSortLoadIdsFromOutput()

Small helper function to get all ids in the output.

Return value

array A list of beatle ids.

1 call to FieldWebTest::clickSortLoadIdsFromOutput()
FieldWebTest::testClickSorting in core/modules/views/src/Tests/Handler/FieldWebTest.php
Tests the click sorting functionality.

File

core/modules/views/src/Tests/Handler/FieldWebTest.php, line 103
Contains \Drupal\views\Tests\Handler\FieldWebTest.

Class

FieldWebTest
Tests fields from within a UI.

Namespace

Drupal\views\Tests\Handler

Code

protected function clickSortLoadIdsFromOutput() {
  $fields = $this
    ->xpath("//td[contains(@class, 'views-field-id')]");
  $ids = array();
  foreach ($fields as $field) {
    $ids[] = (int) $field[0];
  }
  return $ids;
}