You are here

protected function UpdateRegistryTest::setupBasicModules in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php \Drupal\Tests\Core\Update\UpdateRegistryTest::setupBasicModules()

Sets up some modules with some update functions.

10 calls to UpdateRegistryTest::setupBasicModules()
UpdateRegistryTest::testFilterOutInvokedUpdatesByModule in core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@covers ::filterOutInvokedUpdatesByModule
UpdateRegistryTest::testGetModuleUpdateFunctions in core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@covers ::getModuleUpdateFunctions
UpdateRegistryTest::testGetPendingUpdateFunctionsExistingUpdates in core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@covers ::getPendingUpdateFunctions
UpdateRegistryTest::testGetPendingUpdateFunctionsNoExistingUpdates in core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@covers ::getPendingUpdateFunctions
UpdateRegistryTest::testGetPendingUpdateFunctionsWithLoadedModulesButNotEnabled in core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@covers ::getPendingUpdateFunctions

... See full list

File

core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php, line 41
Contains \Drupal\Tests\Core\Update\UpdateRegistryTest.

Class

UpdateRegistryTest
@coversDefaultClass \Drupal\Core\Update\UpdateRegistry @group Update

Namespace

Drupal\Tests\Core\Update

Code

protected function setupBasicModules() {
  $info_a = <<<'EOS'
type: module
name: Module A
core: 8.x
EOS;
  $info_b = <<<'EOS'
type: module
name: Module B
core: 8.x
EOS;
  $module_a = <<<'EOS'
<?php

/**
 * Module A update B.
 */
function module_a_post_update_b() {
}

/**
 * Module A update A.
 */
function module_a_post_update_a() {
}

EOS;
  $module_b = <<<'EOS'
<?php

/**
 * Module B update A.
 */
function module_b_post_update_a() {
}

EOS;
  vfsStream::setup('drupal');
  vfsStream::create([
    'sites' => [
      'default' => [
        'modules' => [
          'module_a' => [
            'module_a.post_update.php' => $module_a,
            'module_a.info.yml' => $info_a,
          ],
          'module_b' => [
            'module_b.post_update.php' => $module_b,
            'module_b.info.yml' => $info_b,
          ],
        ],
      ],
    ],
  ]);
}