Verified Commit 9fdd5efd authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3414563 by quietone, catch, smustgrave, andypost, Spokje: Add new...

Issue #3414563 by quietone, catch, smustgrave, andypost, Spokje: Add new 10.3.x database dump fixtures, without modules deprecated for removal in 11.x
parent 46b8545d
Loading
Loading
Loading
Loading
Loading
+159 KiB

File added.

Preview size limit exceeded, changes collapsed.

+583 KiB

File added.

Preview size limit exceeded, changes collapsed.

+4 −24
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@

use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\user\Entity\User;

// cspell:ignore hola usuario
@@ -28,7 +27,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBase {
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles() {
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../tests/fixtures/update/drupal-9.4.0.filled.standard.php.gz';
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../tests/fixtures/update/drupal-10.3.0.filled.standard.php.gz';
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.update-test-schema-enabled.php';
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.update-test-semver-update-n-enabled.php';
  }
@@ -45,7 +44,6 @@ public function testUpdatedSite() {

    $expected_node_data = [
      [1, 'article', 'en', 'Test Article - New title'],
      [2, 'book', 'en', 'Book page'],
      [4, 'page', 'en', 'Test page'],
      [8, 'test_content_type', 'en', 'Test title'],
    ];
@@ -85,7 +83,7 @@ public function testUpdatedSite() {
    $this->assertSession()->pageTextNotContains('Test 12');
    // Make sure all other field labels are there.
    for ($i = 1; $i <= 23; $i++) {
      if ($i != 12) {
      if (($i != 11) && ($i != 12)) {
        $this->assertSession()->pageTextContains('Test ' . $i);
      }
    }
@@ -123,7 +121,6 @@ public function testUpdatedSite() {
    $this->assertSession()->pageTextContains('Test Article - New title');
    $this->assertSession()->pageTextContains('test.txt');
    $this->assertSession()->pageTextContains('druplicon.small');
    $this->assertSession()->responseContains('General discussion');
    $this->assertSession()->pageTextContains('Test Article - New title');
    $this->assertSession()->pageTextContains('Test 1');
    $this->assertSession()->responseContains('0.01');
@@ -153,8 +150,8 @@ public function testUpdatedSite() {
    $this->drupalGet('admin/structure/views/view/test_view');
    $this->assertSession()->pageTextContains('Test view');

    // Make sure the book node exists.
    $this->drupalGet('admin/structure/book');
    // Make sure the node/1 node exists.
    $this->drupalGet('node/1');
    $this->clickLink('Test Article - New title');
    $this->assertSession()->pageTextContains('Body');
    $this->assertSession()->pageTextContains('Tags');
@@ -183,7 +180,6 @@ public function testUpdatedSite() {
    $this->drupalGet('admin/structure/block/manage/testblock');
    $this->assertSession()->checkboxNotChecked('edit-visibility-language-langcodes-es');
    $this->assertSession()->checkboxChecked('edit-visibility-language-langcodes-en');
    $this->assertSession()->checkboxNotChecked('edit-visibility-entity-bundlenode-bundles-book');
    $this->assertSession()->checkboxChecked('edit-visibility-entity-bundlenode-bundles-test-content-type');

    // Make sure our block is still translated.
@@ -302,13 +298,6 @@ public function testUpdatedSite() {
    // cSpell:disable-next-line
    $this->assertSession()->pageTextContains('Comentario completo');

    // Make sure our custom action is still there.
    $this->drupalGet('admin/config/system/actions');
    $this->assertSession()->pageTextContains('Test action');
    $this->drupalGet('admin/config/system/actions/configure/test_action');
    $this->assertSession()->fieldValueEquals('id', 'test_action');
    $this->assertSession()->responseContains('drupal.org');

    // Make sure our ban still exists.
    $this->drupalGet('admin/config/people/ban');
    $this->assertSession()->pageTextContains('8.8.8.8');
@@ -338,12 +327,10 @@ public function testUpdatedSite() {

    // Make sure our modules are still enabled.
    $expected_enabled_modules = [
      'action',
      'ban',
      'basic_auth',
      'block',
      'block_content',
      'book',
      'breakpoint',
      'ckeditor5',
      'comment',
@@ -384,7 +371,6 @@ public function testUpdatedSite() {
      'telephone',
      'text',
      'toolbar',
      'tracker',
      'update',
      'user',
      'views_ui',
@@ -405,12 +391,6 @@ public function testUpdatedSite() {
    foreach ($expected_enabled_themes as $theme) {
      $this->assertTrue($this->container->get('theme_handler')->themeExists($theme), 'The "' . $theme . '" is still enabled.');
    }

    // Ensure that the Book module's node type does not have duplicated enforced
    // dependencies.
    // @see system_post_update_fix_enforced_dependencies()
    $book_node_type = NodeType::load('book');
    $this->assertEquals(['enforced' => ['module' => ['book']]], $book_node_type->get('dependencies'));
  }

  /**
+3 −3
Original line number Diff line number Diff line
@@ -56,11 +56,11 @@ abstract class UpdatePathTestBase extends BrowserTestBase {
  /**
   * The file path(s) to the dumped database(s) to load into the child site.
   *
   * The file system/tests/fixtures/update/drupal-9.4.0.bare.standard.php.gz is
   * The file system/tests/fixtures/update/drupal-10.3.0.bare.standard.php.gz is
   * normally included first -- this sets up the base database from a bare
   * standard Drupal installation.
   *
   * The file system/tests/fixtures/update/drupal-9.4.0.filled.standard.php.gz
   * The file system/tests/fixtures/update/drupal-10.3.0.filled.standard.php.gz
   * can also be used in case we want to test with a database filled with
   * content, and with all core modules enabled.
   *
@@ -253,7 +253,7 @@ protected function testDatabaseLoaded() {

    /** @var \Drupal\Core\Update\UpdateHookRegistry $update_registry */
    $update_registry = \Drupal::service('update.update_hook_registry');
    foreach (['user' => 9301, 'node' => 8700, 'system' => 8901, 'update_test_schema' => 8000] as $module => $schema) {
    foreach (['user' => 10000, 'node' => 8700, 'system' => 10201, 'update_test_schema' => 8000] as $module => $schema) {
      $this->assertEquals($schema, $update_registry->getInstalledVersion($module), "Module $module schema is $schema");
    }

+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles() {
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-9.4.0.bare.standard.php.gz';
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-10.3.0.bare.standard.php.gz';
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php';
    $this->databaseDumpFiles[] = __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-semver-update-n-enabled.php';
  }