InvalidUpdateHookTest.php in Drupal 8
File
core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\UpdateSystem;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\RequirementsPageTrait;
class InvalidUpdateHookTest extends BrowserTestBase {
use RequirementsPageTrait;
public static $modules = [
'update_test_invalid_hook',
'update_script_test',
'dblog',
];
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 testInvalidUpdateHook() {
$this
->drupalLogin($this->updateUser);
$this
->drupalGet($this->updateUrl);
$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 |
InvalidUpdateHookTest |
Tests that a module implementing hook_update_8000() causes an error to be
displayed on update. |