Issue #3089900 by jibran, alexpott, catch, Berdir, amateescu: Drupal 8.8/8.9/9.0 update test coverage
parent
f2c66f6c34
commit
c2e3f0b323
BIN
core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz
vendored
Normal file
BIN
core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz
vendored
Normal file
Binary file not shown.
BIN
core/modules/system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz
vendored
Normal file
BIN
core/modules/system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz
vendored
Normal file
Binary file not shown.
|
@ -26,7 +26,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBaseTest {
|
|||
*/
|
||||
protected function setDatabaseDumpFiles() {
|
||||
parent::setDatabaseDumpFiles();
|
||||
$this->databaseDumpFiles[0] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
|
||||
$this->databaseDumpFiles[0] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,7 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
|
|||
*/
|
||||
protected function setDatabaseDumpFiles() {
|
||||
$this->databaseDumpFiles = [
|
||||
__DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
|
||||
__DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz',
|
||||
__DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php',
|
||||
__DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-semver-update-n-enabled.php',
|
||||
];
|
||||
|
@ -37,8 +37,8 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
|
|||
// Set a value in the cache to prove caches are cleared.
|
||||
\Drupal::service('cache.default')->set(__CLASS__, 'Test');
|
||||
|
||||
foreach (['user', 'node', 'system', 'update_test_schema'] as $module) {
|
||||
$this->assertEqual(drupal_get_installed_schema_version($module), 8000, new FormattableMarkup('Module @module schema is 8000', ['@module' => $module]));
|
||||
foreach (['user' => 8100, 'node' => 8700, 'system' => 8805, 'update_test_schema' => 8000] as $module => $schema) {
|
||||
$this->assertEqual(drupal_get_installed_schema_version($module), $schema, new FormattableMarkup('Module @module schema is @schema', ['@module' => $module, '@schema' => $schema]));
|
||||
}
|
||||
|
||||
// Ensure that all {router} entries can be unserialized. If they cannot be
|
||||
|
@ -112,14 +112,25 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
|
|||
*/
|
||||
public function testPathAliasProcessing() {
|
||||
// Add a path alias for the '/admin' system path.
|
||||
$values = [
|
||||
'path' => '/admin/structure',
|
||||
'alias' => '/admin-structure-alias',
|
||||
'langcode' => 'und',
|
||||
'status' => 1,
|
||||
];
|
||||
|
||||
$database = \Drupal::database();
|
||||
$database->insert('url_alias')
|
||||
->fields(['source', 'alias', 'langcode'])
|
||||
->values([
|
||||
'source' => '/admin/structure',
|
||||
'alias' => '/admin-structure-alias',
|
||||
'langcode' => 'und',
|
||||
])
|
||||
$id = $database->insert('path_alias')
|
||||
->fields($values + ['uuid' => \Drupal::service('uuid')->generate()])
|
||||
->execute();
|
||||
|
||||
$revision_id = $database->insert('path_alias_revision')
|
||||
->fields($values + ['id' => $id, 'revision_default' => 1])
|
||||
->execute();
|
||||
|
||||
$database->update('path_alias')
|
||||
->fields(['revision_id' => $revision_id])
|
||||
->condition('id', $id)
|
||||
->execute();
|
||||
|
||||
// Increment the schema version.
|
||||
|
|
Loading…
Reference in New Issue