You are here

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

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

Overrides TestBase::setUp

File

tests/src/Unit/Plugin/DMU/Analyzer/TestsTest.php, line 13

Class

TestsTest
@group DMU.Analyzer @covers \Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\Tests

Namespace

Drupal\Tests\drupalmoduleupgrader\Unit\Plugin\DMU\Analyzer

Code

public function setUp() {
  parent::setUp();
  $code = <<<'END'
<?php

class FooTestCase extends DrupalWebTestCase {}
END;
  $this->dir
    ->getChild('foo.test')
    ->setContent($code);
  $indexer = new Classes([], 'class', [], $this->db, $this->target);
  $indexer
    ->build();
  $this->container
    ->get('plugin.manager.drupalmoduleupgrader.indexer')
    ->method('createInstance')
    ->with('class')
    ->willReturn($indexer);
  $this->analyzer = $this
    ->getPlugin();
}