3 namespace Drupal\Tests\system\Functional\Update;
5 use Drupal\Component\Render\FormattableMarkup;
6 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
9 * Tests the update path base class with the RC1 database dump.
14 class UpdatePathRC1TestBaseTest extends UpdatePathTestBase {
19 protected static $modules = ['update_test_schema'];
24 protected function setDatabaseDumpFiles() {
25 $this->databaseDumpFiles = [
26 __DIR__ . '/../../../../tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz',
31 * Tests that the database was properly loaded.
33 public function testDatabaseLoaded() {
34 $extensions = \Drupal::service('config.storage')->read('core.extension');
35 $this->assertFalse(isset($extensions['theme']['stable']), 'Stable is not installed before updating.');
41 foreach ($hook_updates as $module => $schema) {
42 $this->assertEqual(drupal_get_installed_schema_version($module), $schema, new FormattableMarkup('Module @module schema is @schema', ['@module' => $module, '@schema' => $schema]));
45 // Test post_update key value stores contains a list of the update functions
47 $existing_updates = array_count_values(\Drupal::keyValue('post_update')->get('existing_updates'));
49 'system_post_update_recalculate_configuration_entity_dependencies',
50 'field_post_update_save_custom_storage_property',
51 'field_post_update_entity_reference_handler_setting',
52 'block_post_update_disable_blocks_with_missing_contexts',
53 'views_post_update_update_cacheability_metadata',
55 foreach ($expected_updates as $expected_update) {
56 $this->assertEqual($existing_updates[$expected_update], 1, new FormattableMarkup("@expected_update exists in 'existing_updates' key and only appears once.", ['@expected_update' => $expected_update]));
60 $this->assertEqual(\Drupal::config('system.site')->get('name'), 'Site-Install');
61 $this->drupalGet('<front>');
62 $this->assertText('Site-Install');
63 $extensions = \Drupal::service('config.storage')->read('core.extension');
64 $this->assertTrue(isset($extensions['theme']['stable']), 'Stable is installed after updating.');
65 $blocks = \Drupal::entityManager()->getStorage('block')->loadByProperties(['theme' => 'stable']);
66 $this->assertTrue(empty($blocks), 'No blocks have been placed for Stable.');