DbUpdatesTrait.php in Drupal 8
File
core/modules/system/tests/src/Functional/Update/DbUpdatesTrait.php
View source
<?php
namespace Drupal\Tests\system\Functional\Update;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
use Drupal\Tests\RequirementsPageTrait;
trait DbUpdatesTrait {
use StringTranslationTrait;
use RequirementsPageTrait;
protected function enableUpdates($module, $group, $index) {
$this->container
->get('state')
->set($module . '.db_updates.' . $group, $index);
}
protected function applyUpdates() {
$this
->drupalGet(Url::fromRoute('system.db_update'));
$this
->updateRequirementsProblem();
$this
->clickLink($this
->t('Continue'));
$this
->clickLink($this
->t('Apply pending updates'));
$this
->checkForMetaRefresh();
}
}
Traits
Name |
Description |
DbUpdatesTrait |
Provides methods to conditionally enable db update functions and apply
pending db updates through the Update UI. |