You are here

public function FixedBlockAdminTest::doTestExportConfirmFormNoDefaultContent in Fixed Block Content 8

Tests the default content export confirm form.

See also

\Drupal\fixed_block_content\Form\ExportConfirmForm

1 call to FixedBlockAdminTest::doTestExportConfirmFormNoDefaultContent()
FixedBlockAdminTest::testAdmin in tests/src/Functional/FixedBlockAdminTest.php
Full admin test sequence.

File

tests/src/Functional/FixedBlockAdminTest.php, line 65

Class

FixedBlockAdminTest
Tests the fixed block content admin.

Namespace

Drupal\Tests\fixed_block_content\Functional

Code

public function doTestExportConfirmFormNoDefaultContent() {

  // Go to export (restore) block with the default content page.
  $this
    ->drupalGet('admin/structure/block');
  $this
    ->clickLink('Custom block library');
  $this
    ->clickLink('Fixed blocks');
  $this
    ->clickLink('Restore default content');
  $this
    ->assertText('Are you sure you want to restore the Basic fixed to its default content?');

  // Confirm the form.
  $this
    ->drupalPostForm(NULL, [], 'Confirm');
  $block_content = $this->fixedBlock
    ->getBlockContent(FALSE);

  // The block content must be created.
  $this
    ->assertNotNull($block_content);

  // And it must has no body content.
  $this
    ->assertEmpty($block_content
    ->get('body')
    ->getString());
}