You are here

public function ConfigEntityRevisionsRevertFormBaseTest::actionDependsOnWhetherTheRevisionIsPublished in Config Entity Revisions 1.x

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/ConfigEntityRevisionsRevertFormBaseTest.php \Drupal\Tests\config_entity_revisions\Unit\ConfigEntityRevisionsRevertFormBaseTest::actionDependsOnWhetherTheRevisionIsPublished()
  2. 8 tests/src/Unit/ConfigEntityRevisionsRevertFormBaseTest.php \Drupal\Tests\config_entity_revisions\Unit\ConfigEntityRevisionsRevertFormBaseTest::actionDependsOnWhetherTheRevisionIsPublished()

Check that action is calculated as expected.

@test

File

tests/src/Unit/ConfigEntityRevisionsRevertFormBaseTest.php, line 259

Class

ConfigEntityRevisionsRevertFormBaseTest

Namespace

Drupal\Tests\config_entity_revisions\Unit

Code

public function actionDependsOnWhetherTheRevisionIsPublished() {

  // Start with a revision older than the published / default revision.
  $this->instance = $this
    ->getMockInstance(300);
  $actual = $this->instance
    ->get('action');
  $this
    ->assertEquals('revert', $actual);

  // Now use a revision after the published / default revision.
  $this->instance = $this
    ->getMockInstance(324);
  $actual = $this->instance
    ->get('action');
  $this
    ->assertEquals('publish', $actual);
}