InvalidUpdateHookTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php
View source
<?php
namespace Drupal\system\Tests\Update;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Extension\ExtensionSchemaVersionException;
class InvalidUpdateHookTest extends WebTestBase {
public static $modules = array(
'update_test_invalid_hook',
'update_script_test',
'dblog',
);
private $updateUrl;
private $updateUser;
protected function setUp() {
parent::setUp();
require_once \Drupal::root() . '/core/includes/update.inc';
$this->updateUrl = $GLOBALS['base_url'] . '/update.php';
$this->updateUser = $this
->drupalCreateUser(array(
'administer software updates',
));
}
function testInvalidUpdateHook() {
$this
->drupalLogin($this->updateUser);
$this
->drupalGet($this->updateUrl);
$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. |