You are here

protected function AutosaveFormTestBase::assertAutosaveIsRunning in Autosave Form 8

Asserts whether autosave is currently running.

Parameters

bool $running: The expected autosave running state.

1 call to AutosaveFormTestBase::assertAutosaveIsRunning()
ContentEntityAutosaveFormTestBase::doTestConcurrentEditing in tests/src/FunctionalJavascript/ContentEntity/ContentEntityAutosaveFormTestBase.php
Tests concurrent editing.

File

tests/src/FunctionalJavascript/AutosaveFormTestBase.php, line 255

Class

AutosaveFormTestBase
Basic functionality for autosave form tests.

Namespace

Drupal\Tests\autosave_form\FunctionalJavascript

Code

protected function assertAutosaveIsRunning($running) {
  $script = <<<EndOfScript
(function () {
  if (typeof Drupal.autosaveForm !== 'undefined') {
    return Drupal.autosaveForm.autosaveFormRunning;
  }
  else {
    return FALSE;
  }
})();
EndOfScript;
  $is_running = $this
    ->getSession()
    ->evaluateScript($script);
  $this
    ->assertEquals($running, $is_running);
}