function ConnectionTest::testNamespaceDefault

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::testNamespaceDefault()
  2. 10 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::testNamespaceDefault()

@covers ::__construct

File

core/tests/Drupal/Tests/Core/Database/ConnectionTest.php, line 602

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function testNamespaceDefault() : void {
    $mock_pdo = $this->createMock(StubPDO::class);
    $connection = new StubConnection($mock_pdo, []);
    $this->assertSame('Drupal\\Tests\\Core\\Database\\Stub', $connection->getConnectionOptions()['namespace']);
}

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