You are here

function EvaTest::test2873385 in EVA: Entity Views Attachment 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/EvaTest.php \Drupal\Tests\eva\Functional\EvaTest::test2873385()

Test issue described in https://www.drupal.org/node/2873385.

File

tests/src/Functional/EvaTest.php, line 31

Class

EvaTest
Preliminary tests for Eva.

Namespace

Drupal\Tests\eva\Functional

Code

function test2873385() {
  $assert = $this
    ->assertSession();
  $this
    ->drupalGet('/node/' . $this->nids['pages'][0]);
  $assert
    ->statusCodeEquals(200);
  $this
    ->drupalGet('/node/' . $this->nids['pages'][1]);
  $assert
    ->statusCodeEquals(200);
  $this
    ->drupalGet('/2873385');
  $assert
    ->statusCodeEquals(200);

  // the view-eva's' should not all contain the same labels
  $evas = $this
    ->xpath('//div[contains(@class, "view-eva")]');
  $all_links = [];
  foreach ($evas as $x) {
    $links = $x
      ->findAll('xpath', '//a');
    $these_links = [];
    foreach ($links as $l) {
      $these_links[] = $l
        ->getText();
    }
    $all_links[] = implode('-', $these_links);
  }
  $this
    ->assertGreaterThan(1, \count(\array_unique($all_links)), 'Found more than one unique Eva.');
}