UpdatesWith7xTest.php in Drupal 10
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;
protected static $modules = [
'update_test_with_7x',
];
protected $defaultTheme = 'stark';
private $updateUrl;
private $updateUser;
protected function setUp() : void {
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() {
$update_registry = \Drupal::service('update.update_hook_registry');
$this
->assertEquals(8000, $update_registry
->getInstalledVersion('update_test_with_7x'));
$update_registry
->setInstalledVersion('update_test_with_7x', 7110);
$this
->drupalLogin($this->updateUser);
$this
->drupalGet($this->updateUrl, [
'external' => TRUE,
]);
$this
->updateRequirementsProblem();
$this
->clickLink('Continue');
$this
->assertSession()
->pageTextContains('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 . |