test(dump): cover filename parsing and MySQL variant detection
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?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];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user