You are here

protected function FieldEntityTranslationTest::assertRows in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Entity/FieldEntityTranslationTest.php \Drupal\views\Tests\Entity\FieldEntityTranslationTest::assertRows()

Ensures that the rendered results are working as expected.

Parameters

array $expected: The expected rows of the result.

1 call to FieldEntityTranslationTest::assertRows()
FieldEntityTranslationTest::testTranslationRows in core/modules/views/src/Tests/Entity/FieldEntityTranslationTest.php
Tests that different translation mechanisms can be used for base fields.

File

core/modules/views/src/Tests/Entity/FieldEntityTranslationTest.php, line 176
Contains \Drupal\views\Tests\Entity\FieldEntityTranslationTest.

Class

FieldEntityTranslationTest
Tests the rendering of fields (base fields) and their translations.

Namespace

Drupal\views\Tests\Entity

Code

protected function assertRows($expected = []) {
  $actual = [];
  $rows = $this
    ->cssSelect('div.views-row');
  foreach ($rows as $row) {
    $actual[] = [
      'title' => (string) $row
        ->xpath(CssSelector::toXPath('.views-field-title span.field-content a'))[0],
      'sticky' => (string) $row
        ->xpath(CssSelector::toXPath('.views-field-sticky span.field-content'))[0],
    ];
  }
  $this
    ->assertEqual($actual, $expected);
}