You are here

public function TestBase::setUp in Drupal 7 to 8/9 Module Upgrader 8

Mocks an entire module, called foo, in a virtual file system.

Overrides UnitTestCase::setUp

17 calls to TestBase::setUp()
ClassesTest::setUp in tests/src/Unit/Plugin/DMU/Indexer/ClassesTest.php
Mocks an entire module, called foo, in a virtual file system.
DBTest::setUp in tests/src/Unit/Plugin/DMU/Analyzer/DBTest.php
Mocks an entire module, called foo, in a virtual file system.
FlagHookTest::setUp in tests/src/Unit/Plugin/DMU/Analyzer/FlagHookTest.php
Mocks an entire module, called foo, in a virtual file system.
FormStateTest::setUp in tests/src/Unit/Plugin/DMU/Rewriter/FormStateTest.php
Mocks an entire module, called foo, in a virtual file system.
FunctionCallModifierTestBase::setUp in tests/src/Unit/Plugin/DMU/Converter/Functions/FunctionCallModifierTestBase.php
Mocks an entire module, called foo, in a virtual file system.

... See full list

17 methods override TestBase::setUp()
ClassesTest::setUp in tests/src/Unit/Plugin/DMU/Indexer/ClassesTest.php
Mocks an entire module, called foo, in a virtual file system.
DBTest::setUp in tests/src/Unit/Plugin/DMU/Analyzer/DBTest.php
Mocks an entire module, called foo, in a virtual file system.
FlagHookTest::setUp in tests/src/Unit/Plugin/DMU/Analyzer/FlagHookTest.php
Mocks an entire module, called foo, in a virtual file system.
FormStateTest::setUp in tests/src/Unit/Plugin/DMU/Rewriter/FormStateTest.php
Mocks an entire module, called foo, in a virtual file system.
FunctionCallModifierTestBase::setUp in tests/src/Unit/Plugin/DMU/Converter/Functions/FunctionCallModifierTestBase.php
Mocks an entire module, called foo, in a virtual file system.

... See full list

File

tests/src/Unit/TestBase.php, line 45

Class

TestBase
Base class for all DMU tests, providing a useful environment:

Namespace

Drupal\Tests\drupalmoduleupgrader\Unit

Code

public function setUp() {
  $this->info = $this
    ->getAnnotations();
  $this->dir = $this
    ->mockModule('foo');
  $this
    ->mockContainer();
  $this
    ->mockTranslator();
  $this
    ->mockLogger();
  $this
    ->initDB();

  // At the time of this writing, Target will pull the indexer manager out
  // of the container right away, so let's mock it.
  $indexers = $this
    ->createMock('\\Drupal\\Component\\Plugin\\PluginManagerInterface');
  $this->container
    ->set('plugin.manager.drupalmoduleupgrader.indexer', $indexers);
  $this->target = new Target($this->dir
    ->url(), $this->container);
}