You are here

protected function BookTest::setUp in Tome 8

Overrides BrowserTestBase::setUp

File

modules/tome_sync/tests/src/Functional/BookTest.php, line 42

Class

BookTest
Tests that book support works.

Namespace

Drupal\Tests\tome_sync\Functional

Code

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

  // Note: The format for ::writeSettings is really weird.
  $this
    ->writeSettings([
    'settings' => [
      'tome_content_directory' => (object) [
        'value' => $this->siteDirectory . '/files/tome/content',
        'required' => TRUE,
      ],
      'tome_book_outline_directory' => (object) [
        'value' => $this->siteDirectory . '/files/tome/extra',
        'required' => TRUE,
      ],
    ],
  ]);
  $this->bookAuthor = $this
    ->drupalCreateUser([
    'create new books',
    'create book content',
    'edit own book content',
    'add content to books',
  ]);
  $this->webUser = $this
    ->drupalCreateUser([
    'access printer-friendly version',
  ]);
}