3 namespace Drupal\Tests\system\Functional\Update;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests that the minimum schema version is correct even if only 7.x update
13 class UpdatesWith7xTest extends BrowserTestBase {
20 public static $modules = ['update_test_with_7x'];
23 * The URL for the update page.
28 * An administrative user.
32 protected function setUp() {
34 require_once $this->root . '/core/includes/update.inc';
35 $this->updateUrl = $GLOBALS['base_url'] . '/update.php';
36 $this->updateUser = $this->drupalCreateUser(['administer software updates']);
39 public function testWith7x() {
40 // Ensure that the minimum schema version is 8000, despite 7200 update
41 // hooks and a 7XXX hook_update_last_removed().
42 $this->assertEqual(drupal_get_installed_schema_version('update_test_with_7x'), 8000);
44 // Try to manually set the schema version to 7110 and ensure that no
45 // updates are allowed.
46 drupal_set_installed_schema_version('update_test_with_7x', 7110);
48 // Click through update.php with 'administer software updates' permission.
49 $this->drupalLogin($this->updateUser);
50 $this->drupalGet($this->updateUrl, ['external' => TRUE]);
51 $this->clickLink(t('Continue'));
52 $this->assertText(t('Some of the pending updates cannot be applied because their dependencies were not met.'));