phpmyadmin/tests/classes/Partitioning/SubPartitionTest.php
Maurício Meneghini Fauth 1d1c55e250
Move test directory to tests
- Related to #18512

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-11-30 10:47:42 -03:00

39 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests\Partitioning;
use PhpMyAdmin\Partitioning\SubPartition;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
#[CoversClass(SubPartition::class)]
class SubPartitionTest extends TestCase
{
public function testSubPartition(): void
{
$row = [
'TABLE_SCHEMA' => 'TABLE_SCHEMA',
'TABLE_NAME' => 'TABLE_NAME',
'SUBPARTITION_NAME' => 'subpartition_name',
'SUBPARTITION_ORDINAL_POSITION' => 1,
'SUBPARTITION_METHOD' => 'subpartition_method',
'SUBPARTITION_EXPRESSION' => 'subpartition_expression',
'TABLE_ROWS' => 2,
'DATA_LENGTH' => 3,
'INDEX_LENGTH' => 4,
'PARTITION_COMMENT' => 'partition_comment',
];
$object = new SubPartition($row);
$this->assertEquals('subpartition_name', $object->getName());
$this->assertEquals(1, $object->getOrdinal());
$this->assertEquals('subpartition_method', $object->getMethod());
$this->assertEquals('subpartition_expression', $object->getExpression());
$this->assertEquals(2, $object->getRows());
$this->assertEquals(3, $object->getDataLength());
$this->assertEquals(4, $object->getIndexLength());
$this->assertEquals('partition_comment', $object->getComment());
}
}