26 lines
740 B
PHP
26 lines
740 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace AeonDumpManager\Tests\Service;
|
|
|
|
use AeonDumpManager\Service\MySqlVariant;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class MySqlVariantTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider versionProvider
|
|
*/
|
|
public function testIsMariaDb(string $version, bool $expected): void
|
|
{
|
|
self::assertSame($expected, MySqlVariant::isMariaDb($version));
|
|
}
|
|
|
|
public static function versionProvider(): iterable
|
|
{
|
|
yield 'plain mysql' => ['8.0.36', false];
|
|
yield 'mariadb with legacy prefix' => ['5.5.5-10.11.2-MariaDB', true];
|
|
yield 'mariadb without legacy prefix' => ['10.11.2-MariaDB', true];
|
|
yield 'mariadb lowercase' => ['10.11.2-mariadb', true];
|
|
}
|
|
}
|