You are here

class FieldEncryptUpdatePathTest in Field Encryption 3.0.x

Tests that updating from older versions of field encrypt is not supported.

@group field_encrypt @group legacy

Hierarchy

Expanded class hierarchy of FieldEncryptUpdatePathTest

File

tests/src/Functional/FieldEncryptUpdatePathTest.php, line 14

Namespace

Drupal\Tests\field_encrypt\Functional
View source
class FieldEncryptUpdatePathTest extends FieldEncryptTestBase {
  use RequirementsPageTrait;

  /**
   * Tests field_encrypt_requirements().
   */
  public function testUpdate() {
    $this
      ->drupalLogin($this->rootUser);
    $update_url = Url::fromRoute('system.db_update');
    $this
      ->drupalGet($update_url);
    $this
      ->updateRequirementsProblem();
    $this
      ->clickLink('Continue');
    $this
      ->assertSession()
      ->pageTextContains('No pending updates.');

    // Simulate having an old version of field_encrypt.
    drupal_set_installed_schema_version('field_encrypt', 8000);
    $this
      ->drupalGet($update_url);
    $this
      ->assertSession()
      ->pageTextContains('Update to field_encrypt version 3 is not supported.');
    $this
      ->drupalGet('admin/reports/status');
    $this
      ->assertSession()
      ->pageTextContains('Update to field_encrypt version 3 is not supported.');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FieldEncryptTestBase::$entityTypeManager protected property The entity manager service. 1
FieldEncryptTestBase::$modules public static property 3
FieldEncryptTestBase::$nodeType protected property The page node type.
FieldEncryptTestBase::$testNode protected property A test node.
FieldEncryptTestBase::createTestNode protected function Creates a test node. 1
FieldEncryptTestBase::setFieldStorageSettings protected function Set up storage settings for test fields. 1
FieldEncryptTestBase::setTranslationSettings protected function Set up translation settings for content translation test.
FieldEncryptTestBase::setUp protected function @TODO: Simplify setUp() by extending EncryptTestBase when https://www.drupal.org/node/2692387 lands. 1
FieldEncryptUpdatePathTest::testUpdate public function Tests field_encrypt_requirements().
NodeCreationTrait::createNode protected function Creates a node based on default settings.
NodeCreationTrait::getNodeByTitle public function Get a node from the database based on its title.
RequirementsPageTrait::assertWarningSummaries protected function Assert the given warning summaries are present on the page.
RequirementsPageTrait::continueOnExpectedWarnings protected function Continues installation when the expected warnings are found.
RequirementsPageTrait::updateRequirementsProblem protected function Handles the update requirements page.