UpdatesWith7xTest.php in Drupal 8
File
core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\UpdateSystem;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\RequirementsPageTrait;
class UpdatesWith7xTest extends BrowserTestBase {
use RequirementsPageTrait;
public static $modules = [
'update_test_with_7x',
];
protected $defaultTheme = 'stark';
private $updateUrl;
private $updateUser;
protected function setUp() {
parent::setUp();
require_once $this->root . '/core/includes/update.inc';
$this->updateUrl = $GLOBALS['base_url'] . '/update.php';
$this->updateUser = $this
->drupalCreateUser([
'administer software updates',
]);
}
public function testWith7x() {
$this
->assertEqual(drupal_get_installed_schema_version('update_test_with_7x'), 8000);
drupal_set_installed_schema_version('update_test_with_7x', 7110);
$this
->drupalLogin($this->updateUser);
$this
->drupalGet($this->updateUrl, [
'external' => TRUE,
]);
$this
->updateRequirementsProblem();
$this
->clickLink(t('Continue'));
$this
->assertText(t('Some of the pending updates cannot be applied because their dependencies were not met.'));
}
}
Classes
Name |
Description |
UpdatesWith7xTest |
Tests that the minimum schema version is correct even if only 7.x update
hooks are retained . |