function ConnectionTest::setUp

Overrides UnitTestCase::setUp

File

core/modules/mysql/tests/src/Unit/ConnectionTest.php, line 32

Class

ConnectionTest
Tests MySQL database connections.

Namespace

Drupal\Tests\mysql\Unit

Code

protected function setUp() : void {
  parent::setUp();
  $this->connection = $this->getMockBuilder(Connection::class)
    ->setConstructorArgs([
    $this->createMock(\PHP_VERSION_ID >= 80400 ? Mysql::class : \PDO::class),
    [],
  ])
    ->onlyMethods([
    'getServerVersion',
  ])
    ->getMock();
}

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