mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
43 lines
1.2 KiB
PHP
43 lines
1.2 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(10, 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');
|
|
}
|
|
}
|