function UpgradeTest::setUp

Same name in this branch
  1. 10 core/modules/statistics/tests/src/Functional/migrate_drupal/d6/UpgradeTest.php \Drupal\Tests\statistics\Functional\migrate_drupal\d6\UpgradeTest::setUp()
Same name in other branches
  1. 9 core/modules/aggregator/tests/src/Functional/migrate_drupal_ui/d6/UpgradeTest.php \Drupal\Tests\aggregator\Functional\migrate_drupal_ui\d6\UpgradeTest::setUp()
  2. 9 core/modules/aggregator/tests/src/Functional/migrate_drupal_ui/d7/UpgradeTest.php \Drupal\Tests\aggregator\Functional\migrate_drupal_ui\d7\UpgradeTest::setUp()
  3. 11.x core/modules/statistics/tests/src/Functional/migrate_drupal/d6/UpgradeTest.php \Drupal\Tests\statistics\Functional\migrate_drupal\d6\UpgradeTest::setUp()
  4. 11.x core/modules/statistics/tests/src/Functional/migrate_drupal/d7/UpgradeTest.php \Drupal\Tests\statistics\Functional\migrate_drupal\d7\UpgradeTest::setUp()

Overrides MigrateUpgradeExecuteTestBase::setUp

File

core/modules/statistics/tests/src/Functional/migrate_drupal/d7/UpgradeTest.php, line 42

Class

UpgradeTest
Tests Drupal 7 upgrade using the migrate UI.

Namespace

Drupal\Tests\statistics\Functional\migrate_drupal\d7

Code

protected function setUp() : void {
    parent::setUp();
    // @todo remove when https://www.drupal.org/project/drupal/issues/3266491 is
    // fixed.
    // Delete the existing content made to test the ID Conflict form. Migrations
    // are to be done on a site without content. The test of the ID Conflict
    // form is being moved to its own issue which will remove the deletion
    // of the created nodes.
    // See https://www.drupal.org/project/drupal/issues/3087061.
    $this->nodeStorage = $this->container
        ->get('entity_type.manager')
        ->getStorage('node');
    $this->nodeStorage
        ->delete($this->nodeStorage
        ->loadMultiple());
    $this->loadFixture($this->getModulePath('statistics') . '/tests/fixtures/drupal7.php');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.