protected function ClassLoaderTest::setUp in Drupal 8
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ ClassLoader/ ClassLoaderTest.php, line 19
Class
- ClassLoaderTest
- @group ClassLoader @group legacy @runTestsInSeparateProcesses
Namespace
Drupal\Tests\Core\ClassLoaderCode
protected function setUp() {
parent::setUp();
$container = new ContainerBuilder();
$container
->set('app.root', $this->root);
$class_loader = $this
->prophesize(ClassLoader::class);
$class_loader
->addPsr4('Drupal\\foo\\', $this->root . '/modules/bar/src')
->shouldBeCalled();
$container
->set('class_loader', $class_loader
->reveal());
\Drupal::setContainer($container);
}