You are here

public function FieldEncryptUpdatePathTest::testUpdate in Field Encryption 3.0.x

Tests field_encrypt_requirements().

File

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

Class

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

Namespace

Drupal\Tests\field_encrypt\Functional

Code

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.');
}