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
- class \Drupal\Tests\field_encrypt\Functional\FieldEncryptTestBase extends \Drupal\Tests\encrypt\Functional\EncryptTestBase uses NodeCreationTrait
- class \Drupal\Tests\field_encrypt\Functional\FieldEncryptUpdatePathTest uses RequirementsPageTrait
Expanded class hierarchy of FieldEncryptUpdatePathTest
File
- tests/
src/ Functional/ FieldEncryptUpdatePathTest.php, line 14
Namespace
Drupal\Tests\field_encrypt\FunctionalView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldEncryptTestBase:: |
protected | property | The entity manager service. | 1 |
FieldEncryptTestBase:: |
public static | property | 3 | |
FieldEncryptTestBase:: |
protected | property | The page node type. | |
FieldEncryptTestBase:: |
protected | property | A test node. | |
FieldEncryptTestBase:: |
protected | function | Creates a test node. | 1 |
FieldEncryptTestBase:: |
protected | function | Set up storage settings for test fields. | 1 |
FieldEncryptTestBase:: |
protected | function | Set up translation settings for content translation test. | |
FieldEncryptTestBase:: |
protected | function | @TODO: Simplify setUp() by extending EncryptTestBase when https://www.drupal.org/node/2692387 lands. | 1 |
FieldEncryptUpdatePathTest:: |
public | function | Tests field_encrypt_requirements(). | |
NodeCreationTrait:: |
protected | function | Creates a node based on default settings. | |
NodeCreationTrait:: |
public | function | Get a node from the database based on its title. | |
RequirementsPageTrait:: |
protected | function | Assert the given warning summaries are present on the page. | |
RequirementsPageTrait:: |
protected | function | Continues installation when the expected warnings are found. | |
RequirementsPageTrait:: |
protected | function | Handles the update requirements page. |