phpmyadmin/test/classes/Properties/Options/Items/PropertyItemsTest.php
Maurício Meneghini Fauth 555ea56cbd
Make PHPUnit's assertions stricter
Backports #18993 to QA_5_2.

This makes merging QA_5_2 into master easier.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-10-12 15:33:45 -03:00

92 lines
2.2 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests\Properties\Options\Items;
use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
use PhpMyAdmin\Properties\Options\Items\DocPropertyItem;
use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem;
use PhpMyAdmin\Properties\Options\Items\MessageOnlyPropertyItem;
use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem;
use PhpMyAdmin\Properties\Options\Items\SelectPropertyItem;
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
use PhpMyAdmin\Tests\AbstractTestCase;
/**
* @coversNothing
*/
class PropertyItemsTest extends AbstractTestCase
{
public function testBoolText(): void
{
$object = new BoolPropertyItem(null, 'Text');
self::assertSame('Text', $object->getText());
$object->setText('xtext2');
self::assertSame('xtext2', $object->getText());
}
public function testBoolName(): void
{
$object = new BoolPropertyItem('xname');
self::assertSame('xname', $object->getName());
$object->setName('xname2');
self::assertSame('xname2', $object->getName());
}
public function testBoolGetItemType(): void
{
$object = new BoolPropertyItem();
self::assertSame('bool', $object->getItemType());
}
public function testGetItemTypeDoc(): void
{
$object = new DocPropertyItem();
self::assertSame('doc', $object->getItemType());
}
public function testGetItemTypeHidden(): void
{
$object = new HiddenPropertyItem();
self::assertSame('hidden', $object->getItemType());
}
public function testGetItemTypeMessageOnly(): void
{
$object = new MessageOnlyPropertyItem();
self::assertSame('messageOnly', $object->getItemType());
}
public function testGetItemTypeRadio(): void
{
$object = new RadioPropertyItem();
self::assertSame('radio', $object->getItemType());
}
public function testGetItemTypeSelect(): void
{
$object = new SelectPropertyItem();
self::assertSame('select', $object->getItemType());
}
public function testGetItemTypeText(): void
{
$object = new TextPropertyItem();
self::assertSame('text', $object->getItemType());
}
}