protected function UrlConversionTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ Database/ UrlConversionTest.php, line 27
Class
- UrlConversionTest
- Tests for database URL to/from database connection array coversions.
Namespace
Drupal\Tests\Core\DatabaseCode
protected function setUp() {
parent::setUp();
$this->root = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
// Mock the container so we don't need to mock drupal_valid_test_ua().
// @see \Drupal\Core\Extension\ExtensionDiscovery::scan()
$container = $this
->createMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
$container
->expects($this
->any())
->method('has')
->with('kernel')
->willReturn(TRUE);
$container
->expects($this
->any())
->method('get')
->with('site.path')
->willReturn('');
\Drupal::setContainer($container);
new Settings([
'extension_discovery_scan_tests' => TRUE,
]);
}