You are here

public function ConnectionTest::testVersionAndIsMariaDb in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php \Drupal\Tests\Core\Database\Driver\mysql\ConnectionTest::testVersionAndIsMariaDb()

@covers ::version @covers ::isMariaDb @dataProvider providerVersionAndIsMariaDb

File

core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php, line 78

Class

ConnectionTest
Tests MySQL database connections.

Namespace

Drupal\Tests\Core\Database\Driver\mysql

Code

public function testVersionAndIsMariaDb(bool $expected_is_mariadb, string $server_version, string $expected_version) : void {
  $this->pdoStatement
    ->fetchColumn(Argument::any())
    ->shouldBeCalled()
    ->willReturn($server_version);
  $connection = $this
    ->createConnection();
  $is_mariadb = $connection
    ->isMariaDb();
  $version = $connection
    ->version();
  $this
    ->assertSame($expected_is_mariadb, $is_mariadb);
  $this
    ->assertSame($expected_version, $version);
}