public function BookRelationshipTest::testRelationship in Drupal 10
Same name and namespace in other branches
- 8 core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php \Drupal\Tests\book\Functional\Views\BookRelationshipTest::testRelationship()
- 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\ViewsCode
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());
}
}
}