You are here

public function BookRelationshipTest::testRelationship in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php \Drupal\Tests\book\Functional\Views\BookRelationshipTest::testRelationship()
  2. 9 core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php \Drupal\Tests\book\Functional\Views\BookRelationshipTest::testRelationship()

Tests using the views relationship.

File

core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php, line 149

Class

BookRelationshipTest
Tests entity reference relationship data.

Namespace

Drupal\Tests\book\Functional\Views

Code

public function testRelationship() {

  // Create new book.

  /** @var \Drupal\node\NodeInterface[] $nodes */
  $nodes = $this
    ->createBook();
  for ($i = 0; $i < 8; $i++) {
    $this
      ->drupalGet('test-book/' . $nodes[$i]
      ->id());
    for ($j = 0; $j < $i; $j++) {
      $this
        ->assertSession()
        ->linkExists($nodes[$j]
        ->label());
    }
  }
}