You are here

public function TransitionTest::testPublishPendingRevision in Lightning Scheduler 8

File

tests/src/FunctionalJavascript/TransitionTest.php, line 108

Class

TransitionTest
@group lightning_scheduler

Namespace

Drupal\Tests\lightning_scheduler\FunctionalJavascript

Code

public function testPublishPendingRevision() {
  $assert_session = $this
    ->assertSession();
  $page = $this
    ->getSession()
    ->getPage();
  $now = time();
  $this->container
    ->get('module_installer')
    ->install([
    'views',
  ]);
  $page
    ->selectFieldOption('moderation_state[0][state]', 'Published');
  $page
    ->clickLink('Promotion options');
  $page
    ->checkField('Promoted to front page');
  $page
    ->pressButton('Save');
  $this
    ->clickEditLink();
  $page
    ->fillField('Title', 'MC Hammer');
  $page
    ->selectFieldOption('moderation_state[0][state]', 'Draft');
  $this
    ->createTransition('Published', $now + 8);
  $page
    ->pressButton('Save');
  $this
    ->setRequestTime($now + 10);
  $this
    ->cronRun();
  $this
    ->drupalGet('/node');
  $assert_session
    ->linkExists('MC Hammer');
}