You are here

public function MigrationTestBase::test in Lightning Workflow 8.2

Same name and namespace in other branches
  1. 8.3 modules/lightning_scheduler/tests/src/Functional/MigrationTestBase.php \Drupal\Tests\lightning_scheduler\Functional\MigrationTestBase::test()
3 calls to MigrationTestBase::test()
BaseFieldMigrationTest::test in modules/lightning_scheduler/tests/src/Functional/BaseFieldMigrationTest.php
MigrationStatusPageTest::test in modules/lightning_scheduler/tests/src/Functional/MigrationStatusPageTest.php
PurgeTest::test in modules/lightning_scheduler/tests/src/Functional/PurgeTest.php
3 methods override MigrationTestBase::test()
BaseFieldMigrationTest::test in modules/lightning_scheduler/tests/src/Functional/BaseFieldMigrationTest.php
MigrationStatusPageTest::test in modules/lightning_scheduler/tests/src/Functional/MigrationStatusPageTest.php
PurgeTest::test in modules/lightning_scheduler/tests/src/Functional/PurgeTest.php

File

modules/lightning_scheduler/tests/src/Functional/MigrationTestBase.php, line 18

Class

MigrationTestBase

Namespace

Drupal\Tests\lightning_scheduler\Functional

Code

public function test() {
  $this
    ->runUpdates();
  $migrations = $this->container
    ->get('state')
    ->get('lightning_scheduler.migrations');
  $this
    ->assertCount(2, $migrations);
  $this
    ->assertContains('block_content', $migrations);
  $this
    ->assertContains('node', $migrations);
  $assert = $this
    ->assertSession();
  $url = $assert
    ->elementExists('named', [
    'link',
    'migrate your existing content',
  ])
    ->getAttribute('href');
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->drupalGet($url);
  $assert
    ->statusCodeEquals(200);
  $assert
    ->pageTextContains('Migrate scheduled transitions');
  $assert
    ->elementExists('named', [
    'link',
    'switch to maintenance mode',
  ]);
}