function KernelTestBaseTest::testBootEnvironment

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/KernelTestBaseTest.php \Drupal\KernelTests\KernelTestBaseTest::testBootEnvironment()
  2. 10 core/tests/Drupal/KernelTests/KernelTestBaseTest.php \Drupal\KernelTests\KernelTestBaseTest::testBootEnvironment()
  3. 11.x core/tests/Drupal/KernelTests/KernelTestBaseTest.php \Drupal\KernelTests\KernelTestBaseTest::testBootEnvironment()

@covers ::bootEnvironment

File

core/tests/Drupal/KernelTests/KernelTestBaseTest.php, line 34

Class

KernelTestBaseTest
@coversDefaultClass <a href="/api/drupal/core%21tests%21Drupal%21KernelTests%21KernelTestBase.php/class/KernelTestBase/9" title="Base class for functional integration tests." class="local">\Drupal\KernelTests\KernelTestBase</a>

Namespace

Drupal\KernelTests

Code

public function testBootEnvironment() {
    $this->assertMatchesRegularExpression('/^test\\d{8}$/', $this->databasePrefix);
    $this->assertStringStartsWith('vfs://root/sites/simpletest/', $this->siteDirectory);
    $this->assertEquals([
        'root' => [
            'sites' => [
                'simpletest' => [
                    substr($this->databasePrefix, 4) => [
                        'files' => [
                            'config' => [
                                'sync' => [],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ], vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.