function ConnectionTest::setUp

Same name and namespace in other branches
  1. 11.x core/modules/mysql/tests/src/Unit/ConnectionTest.php \Drupal\Tests\mysql\Unit\ConnectionTest::setUp()
  2. 10 core/modules/mysql/tests/src/Unit/ConnectionTest.php \Drupal\Tests\mysql\Unit\ConnectionTest::setUp()
  3. 9 core/modules/mysql/tests/src/Unit/ConnectionTest.php \Drupal\Tests\mysql\Unit\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(Mysql::class),
    [],
  ])
    ->onlyMethods([
    'getServerVersion',
  ])
    ->getMock();
}

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