phpmyadmin/tests/unit/Partitioning/SubPartitionTest.php
Maurício Meneghini Fauth 606f66b5df
Rename tests/classes to tests/unit
This directory is for unit tests only, so let's rename it to unit to be
more clear.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-02-23 13:29:07 -03:00

39 lines
1.3 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);
self::assertSame('subpartition_name', $object->getName());
self::assertSame(1, $object->getOrdinal());
self::assertSame('subpartition_method', $object->getMethod());
self::assertSame('subpartition_expression', $object->getExpression());
self::assertSame(2, $object->getRows());
self::assertSame(3, $object->getDataLength());
self::assertSame(4, $object->getIndexLength());
self::assertSame('partition_comment', $object->getComment());
}
}