You are here

protected function BookTest::setUp in Drupal 10

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

File

core/modules/book/tests/src/Functional/BookTest.php, line 60

Class

BookTest
Create a book, add pages, and test book interface.

Namespace

Drupal\Tests\book\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->drupalPlaceBlock('system_breadcrumb_block');
  $this
    ->drupalPlaceBlock('page_title_block');

  // node_access_test requires a node_access_rebuild().
  node_access_rebuild();

  // Create users.
  $this->bookAuthor = $this
    ->drupalCreateUser([
    'create new books',
    'create book content',
    'edit own book content',
    'add content to books',
    'view own unpublished content',
  ]);
  $this->webUser = $this
    ->drupalCreateUser([
    'access printer-friendly version',
    'node test view',
  ]);
  $this->webUserWithoutNodeAccess = $this
    ->drupalCreateUser([
    'access printer-friendly version',
  ]);
  $this->adminUser = $this
    ->drupalCreateUser([
    'create new books',
    'create book content',
    'edit any book content',
    'delete any book content',
    'add content to books',
    'administer blocks',
    'administer permissions',
    'administer book outlines',
    'node test view',
    'administer content types',
    'administer site configuration',
    'view any unpublished content',
  ]);
}