You are here

protected function ThunderJavascriptTestBase::setPublishedStatus in Thunder 8.3

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setPublishedStatus()
  2. 8.2 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setPublishedStatus()
  3. 8.4 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setPublishedStatus()
  4. 6.2.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setPublishedStatus()
  5. 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setPublishedStatus()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setPublishedStatus()

Set entity status.

TRUE - Published. FALSE - Unpublished.

Parameters

bool $status: Entity published or not.

1 call to ThunderJavascriptTestBase::setPublishedStatus()
LiveblogTest::testWithPusher in tests/src/FunctionalJavascript/Integration/LiveblogTest.php
Testing of module integration.

File

tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php, line 393

Class

ThunderJavascriptTestBase
Base class for Thunder Javascript functional tests.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

protected function setPublishedStatus($status = TRUE) {
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->scrollElementInView('#edit-status-value');
  if ($status) {
    $page
      ->find('xpath', '//*[@id="edit-status-value"]')
      ->check();
  }
  else {
    $page
      ->find('xpath', '//*[@id="edit-status-value"]')
      ->uncheck();
  }
}