mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-07-31 06:15:56 -04:00
31 lines
1.1 KiB
PHP
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');
|
|
}
|
|
}
|