Skip to content

Commit fa168ab

Browse files
committed
Add tests for #20262
Pull-request: #20262 Ref: #18204 Signed-off-by: William Desportes <williamdes@wdes.fr>
1 parent 03ef236 commit fa168ab

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

test/classes/Engines/InnodbTest.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PhpMyAdmin\Tests\Engines;
66

7+
use PhpMyAdmin\DatabaseInterface;
78
use PhpMyAdmin\Engines\Innodb;
89
use PhpMyAdmin\Tests\AbstractTestCase;
910

@@ -248,4 +249,49 @@ public function testGetInnodbFileFormat(): void
248249
{
249250
self::assertSame('Antelope', $this->object->getInnodbFileFormat());
250251
}
252+
253+
/**
254+
* Test for getInnodbFileFormat on MySQL 8
255+
*/
256+
public function testGetInnodbFileFormatOnMySQL8(): void
257+
{
258+
global $dbi;
259+
260+
$dbi = $this->createStub(DatabaseInterface::class);
261+
262+
$dbi->method('isMariaDB')->willReturn(false);
263+
$dbi->method('getVersion')->willReturn(80000);
264+
265+
self::assertSame('', $this->object->getInnodbFileFormat());
266+
}
267+
268+
/**
269+
* Test for getInnodbFileFormat on MySQL 5
270+
*/
271+
public function testGetInnodbFileFormatOnMySQL5(): void
272+
{
273+
global $dbi;
274+
275+
$dbi = $this->createStub(DatabaseInterface::class);
276+
277+
$dbi->method('isMariaDB')->willReturn(false);
278+
$dbi->method('getVersion')->willReturn(50000);
279+
280+
self::assertSame('', $this->object->getInnodbFileFormat());
281+
}
282+
283+
/**
284+
* Test for getInnodbFileFormat on MariaDB 10.6
285+
*/
286+
public function testGetInnodbFileFormatOnMariaDB106(): void
287+
{
288+
global $dbi;
289+
290+
$dbi = $this->createStub(DatabaseInterface::class);
291+
292+
$dbi->method('isMariaDB')->willReturn(true);
293+
$dbi->method('getVersion')->willReturn(100600);
294+
295+
self::assertSame('', $this->object->getInnodbFileFormat());
296+
}
251297
}

0 commit comments

Comments
 (0)