You are here

public function PanelsEverywhereTest::testBlockPlacement in Panels Everywhere 8.4

Verify that placed blocks actually show up.

File

tests/src/Functional/PanelsEverywhereTest.php, line 79

Class

PanelsEverywhereTest
Make sure that PE can be enabled.

Namespace

Drupal\Tests\panels_everywhere\Functional

Code

public function testBlockPlacement() {
  $this
    ->enableSiteTemplate();
  $this
    ->checkFrontPageWorks();
  $this
    ->assertSession()
    ->pageTextNotContains('Powered by');
  $siteTemplate = $this
    ->loadSiteTemplate();
  $defaultVariant = $siteTemplate
    ->getVariant('panels_everywhere');
  $this
    ->placeBlockOnVariant($defaultVariant, 'system_powered_by_block', 'content');
  $defaultVariant
    ->save();

  // @todo: Remove once cache info is setup correctly
  drupal_flush_all_caches();
  $this
    ->checkFrontPageWorks();
  $this
    ->assertSession()
    ->pageTextContains('Powered by');
  $this
    ->assertSession()
    ->pageTextNotContains('No front page content has been created yet.');
  $siteTemplate = $this
    ->loadSiteTemplate();
  $defaultVariant = $siteTemplate
    ->getVariant('panels_everywhere');
  $this
    ->placeBlockOnVariant($defaultVariant, 'system_main_block', 'content');
  $defaultVariant
    ->save();

  // @todo: Remove once cache info is setup correctly
  drupal_flush_all_caches();
  $this
    ->checkFrontPageWorks();
  $this
    ->assertSession()
    ->pageTextContains('No front page content has been created yet.');
}