phpmyadmin/test/classes/CharsetsTest.php
Maurício Meneghini Fauth 3baad2eb1c Fix some coding standard issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-25 22:42:37 -03:00

56 lines
1.3 KiB
PHP

<?php
/**
* Tests for MySQL Charsets
*/
declare(strict_types=1);
namespace PhpMyAdmin\Tests;
use PhpMyAdmin\Charsets;
/**
* Tests for MySQL Charsets
*/
class CharsetsTest extends AbstractTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['DBG']['sql'] = false;
$GLOBALS['cfg']['Server']['DisableIS'] = false;
}
public function testFindCollationByName(): void
{
$this->assertNull(Charsets::findCollationByName(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['DisableIS'],
null
));
$this->assertNull(Charsets::findCollationByName(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['DisableIS'],
''
));
$this->assertNull(Charsets::findCollationByName(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['DisableIS'],
'invalid'
));
$actual = Charsets::findCollationByName(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['DisableIS'],
'utf8_general_ci'
);
$this->assertInstanceOf(Charsets\Collation::class, $actual);
$this->assertSame('utf8_general_ci', $actual->getName());
}
}