Files
ops-Gazelle/tests/phpunit/MysqlInfoTest.php
T
2025-07-28 16:55:17 +02:00

31 lines
1.1 KiB
PHP

<?php
namespace Gazelle;
use PHPUnit\Framework\TestCase;
use Gazelle\Enum\Direction;
use Gazelle\Enum\MysqlInfoOrderBy;
use Gazelle\Enum\MysqlTableMode;
class MysqlInfoTest extends TestCase {
public function testDirection(): void {
$this->assertEquals(MysqlInfoOrderBy::totalLength, DB\MysqlInfo::lookupOrderby('total_length'), 'mysqlfo-orderby-totallength');
$this->assertEquals(MysqlInfoOrderBy::tableName, DB\MysqlInfo::lookupOrderby('table_name'), 'mysqlfo-orderby-tablename');
$this->assertEquals(MysqlInfoOrderBy::tableName, DB\MysqlInfo::lookupOrderby('wut'), 'mysqlfo-orderby-default');
}
public function testMysqlInfoColumn(): void {
$this->assertCount(9, DB\MysqlInfo::columnList(), 'myinfo-column-list');
}
public function testMysqlInfoList(): void {
$mysqlInfo = new DB\MysqlInfo(
MysqlTableMode::all,
MysqlInfoOrderBy::tableName,
Direction::descending,
);
$list = $mysqlInfo->info();
$this->assertEquals('xbt_snatched', current($list)['table_name'], 'mysqlinfo-list');
}
}