You are here

public function CollapseActionTest::setUp in Collapsiblock 3.x

Same name and namespace in other branches
  1. 4.x tests/src/FunctionalJavascript/CollapseActionTest.php \Drupal\Tests\collapsiblock\FunctionalJavascript\CollapseActionTest::setUp()

Overrides CollapsiblockJavaScriptTestBase::setUp

File

tests/src/FunctionalJavascript/CollapseActionTest.php, line 43

Class

CollapseActionTest
Test that collapse actions work as-intended.

Namespace

Drupal\Tests\collapsiblock\FunctionalJavascript

Code

public function setUp() {
  parent::setUp();
  $this->collapsiblockTestBlock = $this
    ->drupalPlaceBlock('system_powered_by_block', [
    'label_display' => TRUE,
  ]);
  $this->collapsiblockTestBlockHtmlId = 'block-' . $this->collapsiblockTestBlock
    ->id();
  $this->collapsiblockTestBlockTitleXpath = $this
    ->assertSession()
    ->buildXPathQuery('//*[@id=:blockId]//h2', [
    ':blockId' => $this->collapsiblockTestBlockHtmlId,
  ]);
  $this->collapsiblockTestBlockContentXpath = $this
    ->assertSession()
    ->buildXPathQuery('//*[@id=:blockId]//span', [
    ':blockId' => $this->collapsiblockTestBlockHtmlId,
  ]);
}