3 namespace Drupal\Tests\system\Functional\Update;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests that a module implementing hook_update_8000() causes an error to be
13 class InvalidUpdateHookTest extends BrowserTestBase {
20 public static $modules = ['update_test_invalid_hook', 'update_script_test', 'dblog'];
23 * URL for the upgrade script.
30 * A user account with upgrade permission.
32 * @var \Drupal\user\UserInterface
36 protected function setUp() {
38 require_once $this->root . '/core/includes/update.inc';
40 $this->updateUrl = $GLOBALS['base_url'] . '/update.php';
41 $this->updateUser = $this->drupalCreateUser(['administer software updates']);
44 public function testInvalidUpdateHook() {
45 // Confirm that a module with hook_update_8000() cannot be updated.
46 $this->drupalLogin($this->updateUser);
47 $this->drupalGet($this->updateUrl);
48 $this->clickLink(t('Continue'));
49 $this->assertText(t('Some of the pending updates cannot be applied because their dependencies were not met.'));