Add tests for #20262

Pull-request: #20262
Ref: #18204

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2026-04-09 14:36:01 +02:00
parent 03ef236b57
commit fa168ab7a3
No known key found for this signature in database
GPG Key ID: 70684F4717D49A31

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Tests\Engines;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Engines\Innodb;
use PhpMyAdmin\Tests\AbstractTestCase;
@ -248,4 +249,49 @@ class InnodbTest extends AbstractTestCase
{
self::assertSame('Antelope', $this->object->getInnodbFileFormat());
}
/**
* Test for getInnodbFileFormat on MySQL 8
*/
public function testGetInnodbFileFormatOnMySQL8(): void
{
global $dbi;
$dbi = $this->createStub(DatabaseInterface::class);
$dbi->method('isMariaDB')->willReturn(false);
$dbi->method('getVersion')->willReturn(80000);
self::assertSame('', $this->object->getInnodbFileFormat());
}
/**
* Test for getInnodbFileFormat on MySQL 5
*/
public function testGetInnodbFileFormatOnMySQL5(): void
{
global $dbi;
$dbi = $this->createStub(DatabaseInterface::class);
$dbi->method('isMariaDB')->willReturn(false);
$dbi->method('getVersion')->willReturn(50000);
self::assertSame('', $this->object->getInnodbFileFormat());
}
/**
* Test for getInnodbFileFormat on MariaDB 10.6
*/
public function testGetInnodbFileFormatOnMariaDB106(): void
{
global $dbi;
$dbi = $this->createStub(DatabaseInterface::class);
$dbi->method('isMariaDB')->willReturn(true);
$dbi->method('getVersion')->willReturn(100600);
self::assertSame('', $this->object->getInnodbFileFormat());
}
}