function BookRelationshipTest::testRelationship
Same name in other branches
- 9 core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php \Drupal\Tests\book\Functional\Views\BookRelationshipTest::testRelationship()
- 8.9.x core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php \Drupal\Tests\book\Functional\Views\BookRelationshipTest::testRelationship()
- 10 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 151
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());
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.