Merge pull request #18486 from MauricioFauth/phpunit-attributes
Replace PHPUnit annotations with attributes
This commit is contained in:
commit
dbb0ad4a66
1008
psalm-baseline.xml
1008
psalm-baseline.xml
File diff suppressed because it is too large
Load Diff
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Advisory;
|
||||
|
||||
use PhpMyAdmin\Advisory\Advisor;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
||||
|
||||
/** @covers \PhpMyAdmin\Advisory\Advisor */
|
||||
#[CoversClass(Advisor::class)]
|
||||
class AdvisorTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
@ -26,9 +28,8 @@ class AdvisorTest extends AbstractTestCase
|
||||
*
|
||||
* @param float $time time
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @dataProvider advisorTimes
|
||||
*/
|
||||
#[DataProvider('advisorTimes')]
|
||||
public function testAdvisorBytime(float $time, string $expected): void
|
||||
{
|
||||
$result = Advisor::byTime($time, 2);
|
||||
@ -53,9 +54,8 @@ class AdvisorTest extends AbstractTestCase
|
||||
* @param mixed[] $rule Rule to test
|
||||
* @param mixed[] $expected Expected rendered rule in fired/errors list
|
||||
* @param string|null $error Expected error string (null if none error expected)
|
||||
*
|
||||
* @dataProvider rulesProvider
|
||||
*/
|
||||
#[DataProvider('rulesProvider')]
|
||||
public function testAddRule(array $rule, array $expected, string|null $error): void
|
||||
{
|
||||
parent::setLanguage();
|
||||
|
||||
@ -5,19 +5,16 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Advisory;
|
||||
|
||||
use PhpMyAdmin\Advisory\Rules;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Advisory\Rules
|
||||
* @psalm-import-type RuleType from Rules
|
||||
*/
|
||||
/** @psalm-import-type RuleType from Rules */
|
||||
#[CoversClass(Rules::class)]
|
||||
class RulesTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @psalm-param callable(): list<RuleType> $rulesFactory
|
||||
*
|
||||
* @dataProvider providerForTestRules
|
||||
*/
|
||||
/** @psalm-param callable(): list<RuleType> $rulesFactory */
|
||||
#[DataProvider('providerForTestRules')]
|
||||
public function testRules(callable $rulesFactory): void
|
||||
{
|
||||
$rules = $rulesFactory();
|
||||
|
||||
@ -10,8 +10,9 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Identifiers\DatabaseName;
|
||||
use PhpMyAdmin\Identifiers\TableName;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Bookmark */
|
||||
#[CoversClass(Bookmark::class)]
|
||||
class BookmarkTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -7,8 +7,9 @@ namespace PhpMyAdmin\Tests;
|
||||
use PhpMyAdmin\BrowseForeigners;
|
||||
use PhpMyAdmin\Config;
|
||||
use PhpMyAdmin\Template;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\BrowseForeigners */
|
||||
#[CoversClass(BrowseForeigners::class)]
|
||||
class BrowseForeignersTest extends AbstractTestCase
|
||||
{
|
||||
private BrowseForeigners $browseForeigners;
|
||||
|
||||
@ -5,9 +5,11 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\Cache;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use stdClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Cache */
|
||||
#[CoversClass(Cache::class)]
|
||||
class CacheTest extends AbstractTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
@ -25,7 +27,7 @@ class CacheTest extends AbstractTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderCacheKeyValues */
|
||||
#[DataProvider('dataProviderCacheKeyValues')]
|
||||
public function testCacheHas(string $cacheKey, mixed $valueToCache): void
|
||||
{
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
@ -35,7 +37,7 @@ class CacheTest extends AbstractTestCase
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderCacheKeyValues */
|
||||
#[DataProvider('dataProviderCacheKeyValues')]
|
||||
public function testCachePurge(string $cacheKey, mixed $valueToCache): void
|
||||
{
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
@ -45,7 +47,7 @@ class CacheTest extends AbstractTestCase
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderCacheKeyValues */
|
||||
#[DataProvider('dataProviderCacheKeyValues')]
|
||||
public function testCacheSet(string $cacheKey, mixed $valueToCache): void
|
||||
{
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
@ -53,7 +55,7 @@ class CacheTest extends AbstractTestCase
|
||||
$this->assertTrue(Cache::has($cacheKey));
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderCacheKeyValues */
|
||||
#[DataProvider('dataProviderCacheKeyValues')]
|
||||
public function testCacheGet(string $cacheKey, mixed $valueToCache): void
|
||||
{
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
@ -62,7 +64,7 @@ class CacheTest extends AbstractTestCase
|
||||
$this->assertSame(Cache::get($cacheKey), $valueToCache);
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderCacheKeyValues */
|
||||
#[DataProvider('dataProviderCacheKeyValues')]
|
||||
public function testCacheGetDefaultValue(string $cacheKey, mixed $valueToCache): void
|
||||
{
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
@ -77,7 +79,7 @@ class CacheTest extends AbstractTestCase
|
||||
$this->assertFalse(Cache::get($cacheKey, false));
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderCacheKeyValues */
|
||||
#[DataProvider('dataProviderCacheKeyValues')]
|
||||
public function testCacheRemove(string $cacheKey, mixed $valueToCache): void
|
||||
{
|
||||
$this->assertFalse(Cache::has($cacheKey));
|
||||
|
||||
@ -6,8 +6,9 @@ namespace PhpMyAdmin\Tests\Charsets;
|
||||
|
||||
use PhpMyAdmin\Charsets\Charset;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Charsets\Charset */
|
||||
#[CoversClass(Charset::class)]
|
||||
class CharsetTest extends AbstractTestCase
|
||||
{
|
||||
public function testFromServer(): void
|
||||
|
||||
@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Charsets;
|
||||
|
||||
use PhpMyAdmin\Charsets\Collation;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/** @covers \PhpMyAdmin\Charsets\Collation */
|
||||
#[CoversClass(Collation::class)]
|
||||
class CollationTest extends AbstractTestCase
|
||||
{
|
||||
public function testFromServer(): void
|
||||
@ -40,9 +42,8 @@ class CollationTest extends AbstractTestCase
|
||||
*
|
||||
* @param string $collation Collation for which description is reqd
|
||||
* @param string $description Expected Description
|
||||
*
|
||||
* @dataProvider providerTestBuildDescription
|
||||
*/
|
||||
#[DataProvider('providerTestBuildDescription')]
|
||||
public function testBuildDescription(string $collation, string $description): void
|
||||
{
|
||||
$actual = Collation::fromServer(['Collation' => $collation]);
|
||||
|
||||
@ -5,12 +5,13 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\Charsets;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\PreserveGlobalState;
|
||||
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Charsets
|
||||
* @runTestsInSeparateProcesses
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
#[CoversClass(Charsets::class)]
|
||||
#[PreserveGlobalState(false)]
|
||||
#[RunTestsInSeparateProcesses]
|
||||
class CharsetsTest extends AbstractTestCase
|
||||
{
|
||||
public function testGetServerCharset(): void
|
||||
|
||||
@ -6,8 +6,9 @@ namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\CheckUserPrivileges;
|
||||
use PhpMyAdmin\ShowGrants;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\CheckUserPrivileges */
|
||||
#[CoversClass(CheckUserPrivileges::class)]
|
||||
class CheckUserPrivilegesTest extends AbstractTestCase
|
||||
{
|
||||
private CheckUserPrivileges $checkUserPrivileges;
|
||||
|
||||
@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Command;
|
||||
|
||||
use PhpMyAdmin\Command\SetVersionCommand;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use RangeException;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
||||
use function class_exists;
|
||||
use function sprintf;
|
||||
|
||||
/** @covers \PhpMyAdmin\Command\SetVersionCommand */
|
||||
#[CoversClass(SetVersionCommand::class)]
|
||||
class SetVersionCommandTest extends AbstractTestCase
|
||||
{
|
||||
private SetVersionCommand $command;
|
||||
@ -49,7 +51,7 @@ class SetVersionCommandTest extends AbstractTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderBadVersions */
|
||||
#[DataProvider('dataProviderBadVersions')]
|
||||
public function testGetGeneratedClassInvalidVersion(string $version): void
|
||||
{
|
||||
if (! class_exists(Command::class)) {
|
||||
@ -161,7 +163,7 @@ class SetVersionCommandTest extends AbstractTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @dataProvider dataProviderGoodVersions */
|
||||
#[DataProvider('dataProviderGoodVersions')]
|
||||
public function testGetGeneratedClassValidVersion(string $version, string $content): void
|
||||
{
|
||||
if (! class_exists(Command::class)) {
|
||||
|
||||
@ -6,6 +6,7 @@ namespace PhpMyAdmin\Tests\Command;
|
||||
|
||||
use PhpMyAdmin\Command\TwigLintCommand;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Source;
|
||||
@ -18,7 +19,7 @@ use const SORT_NATURAL;
|
||||
use const SORT_REGULAR;
|
||||
use const TEST_PATH;
|
||||
|
||||
/** @covers \PhpMyAdmin\Command\TwigLintCommand */
|
||||
#[CoversClass(TwigLintCommand::class)]
|
||||
class TwigLintCommandTest extends AbstractTestCase
|
||||
{
|
||||
private TwigLintCommand $command;
|
||||
|
||||
@ -6,12 +6,13 @@ namespace PhpMyAdmin\Tests\Command;
|
||||
|
||||
use PhpMyAdmin\Command\WriteGitRevisionCommand;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
||||
use function class_exists;
|
||||
use function sprintf;
|
||||
|
||||
/** @covers \PhpMyAdmin\Command\WriteGitRevisionCommand */
|
||||
#[CoversClass(WriteGitRevisionCommand::class)]
|
||||
class WriteGitRevisionCommandTest extends AbstractTestCase
|
||||
{
|
||||
private WriteGitRevisionCommand $command;
|
||||
|
||||
@ -5,8 +5,9 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\Common;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Common */
|
||||
#[CoversClass(Common::class)]
|
||||
class CommonTest extends AbstractTestCase
|
||||
{
|
||||
public function testCheckTokenRequestParam(): void
|
||||
|
||||
@ -7,12 +7,14 @@ namespace PhpMyAdmin\Tests\Config;
|
||||
use PhpMyAdmin\Config\ConfigFile;
|
||||
use PhpMyAdmin\Config\Settings;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use stdClass;
|
||||
|
||||
use function array_keys;
|
||||
use function count;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\ConfigFile */
|
||||
#[CoversClass(ConfigFile::class)]
|
||||
class ConfigFileTest extends AbstractTestCase
|
||||
{
|
||||
/**
|
||||
@ -276,9 +278,8 @@ class ConfigFileTest extends AbstractTestCase
|
||||
|
||||
/**
|
||||
* Test for ConfigFile::getFlatDefaultConfig
|
||||
*
|
||||
* @group medium
|
||||
*/
|
||||
#[Group('medium')]
|
||||
public function testGetFlatDefaultConfig(): void
|
||||
{
|
||||
$flatDefaultConfig = $this->object->getFlatDefaultConfig();
|
||||
|
||||
@ -7,15 +7,17 @@ namespace PhpMyAdmin\Tests\Config;
|
||||
use PhpMyAdmin\Config\Descriptions;
|
||||
use PhpMyAdmin\Config\Settings;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\PreserveGlobalState;
|
||||
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
|
||||
|
||||
use function array_keys;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Config\Descriptions
|
||||
* @runTestsInSeparateProcesses
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
#[CoversClass(Descriptions::class)]
|
||||
#[PreserveGlobalState(false)]
|
||||
#[RunTestsInSeparateProcesses]
|
||||
class DescriptionTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
@ -29,9 +31,8 @@ class DescriptionTest extends AbstractTestCase
|
||||
* @param string $item item
|
||||
* @param string $type type
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @dataProvider getValues
|
||||
*/
|
||||
#[DataProvider('getValues')]
|
||||
public function testGet(string $item, string $type, string $expected): void
|
||||
{
|
||||
$this->assertEquals($expected, Descriptions::get($item, $type));
|
||||
|
||||
@ -7,8 +7,9 @@ namespace PhpMyAdmin\Tests\Config;
|
||||
use PhpMyAdmin\Config;
|
||||
use PhpMyAdmin\Config\FormDisplayTemplate;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\FormDisplayTemplate */
|
||||
#[CoversClass(FormDisplayTemplate::class)]
|
||||
class FormDisplayTemplateTest extends AbstractTestCase
|
||||
{
|
||||
protected FormDisplayTemplate $formDisplayTemplate;
|
||||
|
||||
@ -8,6 +8,8 @@ use PhpMyAdmin\Config\ConfigFile;
|
||||
use PhpMyAdmin\Config\Form;
|
||||
use PhpMyAdmin\Config\FormDisplay;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use ReflectionClass;
|
||||
use ReflectionMethod;
|
||||
use ReflectionProperty;
|
||||
@ -15,7 +17,7 @@ use ReflectionProperty;
|
||||
use function function_exists;
|
||||
use function gettype;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\FormDisplay */
|
||||
#[CoversClass(FormDisplay::class)]
|
||||
class FormDisplayTest extends AbstractTestCase
|
||||
{
|
||||
protected FormDisplay $object;
|
||||
@ -48,9 +50,8 @@ class FormDisplayTest extends AbstractTestCase
|
||||
|
||||
/**
|
||||
* Test for FormDisplay::registerForm
|
||||
*
|
||||
* @group medium
|
||||
*/
|
||||
#[Group('medium')]
|
||||
public function testRegisterForm(): void
|
||||
{
|
||||
$reflection = new ReflectionClass(FormDisplay::class);
|
||||
@ -80,9 +81,8 @@ class FormDisplayTest extends AbstractTestCase
|
||||
|
||||
/**
|
||||
* Test for FormDisplay::process
|
||||
*
|
||||
* @group medium
|
||||
*/
|
||||
#[Group('medium')]
|
||||
public function testProcess(): void
|
||||
{
|
||||
$this->assertFalse(
|
||||
|
||||
@ -7,13 +7,15 @@ namespace PhpMyAdmin\Tests\Config;
|
||||
use PhpMyAdmin\Config\ConfigFile;
|
||||
use PhpMyAdmin\Config\Form;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use ReflectionClass;
|
||||
use ReflectionProperty;
|
||||
|
||||
use function array_keys;
|
||||
use function preg_match;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Form */
|
||||
#[CoversClass(Form::class)]
|
||||
class FormTest extends AbstractTestCase
|
||||
{
|
||||
protected Form $object;
|
||||
@ -50,9 +52,8 @@ class FormTest extends AbstractTestCase
|
||||
|
||||
/**
|
||||
* Test for Form::__constructor
|
||||
*
|
||||
* @group medium
|
||||
*/
|
||||
#[Group('medium')]
|
||||
public function testContructor(): void
|
||||
{
|
||||
$this->assertEquals(1, $this->object->index);
|
||||
|
||||
@ -8,16 +8,19 @@ use PhpMyAdmin\Config\ConfigFile;
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
use PhpMyAdmin\Config\Forms\BaseFormList;
|
||||
use PhpMyAdmin\Config\Forms\Page;
|
||||
use PhpMyAdmin\Config\Forms\Page\PageFormList;
|
||||
use PhpMyAdmin\Config\Forms\Setup;
|
||||
use PhpMyAdmin\Config\Forms\Setup\SetupFormList;
|
||||
use PhpMyAdmin\Config\Forms\User;
|
||||
use PhpMyAdmin\Config\Forms\User\UserFormList;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Config\Forms\BaseFormList
|
||||
* @covers \PhpMyAdmin\Config\Forms\Page\PageFormList
|
||||
* @covers \PhpMyAdmin\Config\Forms\Setup\SetupFormList
|
||||
* @covers \PhpMyAdmin\Config\Forms\User\UserFormList
|
||||
*/
|
||||
#[CoversClass(BaseFormList::class)]
|
||||
#[CoversClass(PageFormList::class)]
|
||||
#[CoversClass(SetupFormList::class)]
|
||||
#[CoversClass(UserFormList::class)]
|
||||
class FormListTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
@ -36,9 +39,8 @@ class FormListTest extends AbstractTestCase
|
||||
* @param string $prefix Returned class prefix
|
||||
* @psalm-param class-string<BaseFormList> $class
|
||||
* @psalm-param class-string<BaseForm> $prefix
|
||||
*
|
||||
* @dataProvider formObjects
|
||||
*/
|
||||
#[DataProvider('formObjects')]
|
||||
public function testForms(string $class, string $prefix): void
|
||||
{
|
||||
$cf = new ConfigFile($GLOBALS['config']->baseSettings);
|
||||
|
||||
@ -6,8 +6,9 @@ namespace PhpMyAdmin\Tests\Config;
|
||||
|
||||
use PhpMyAdmin\Config\PageSettings;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\PageSettings */
|
||||
#[CoversClass(PageSettings::class)]
|
||||
class PageSettingsTest extends AbstractTestCase
|
||||
{
|
||||
/**
|
||||
|
||||
@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Config;
|
||||
use PhpMyAdmin\Config\ConfigFile;
|
||||
use PhpMyAdmin\Config\ServerConfigChecks;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use ReflectionException;
|
||||
use ReflectionProperty;
|
||||
|
||||
@ -16,7 +17,7 @@ use function str_repeat;
|
||||
|
||||
use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\ServerConfigChecks */
|
||||
#[CoversClass(ServerConfigChecks::class)]
|
||||
class ServerConfigChecksTest extends AbstractTestCase
|
||||
{
|
||||
private string $sessionID;
|
||||
|
||||
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\Console;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\Console */
|
||||
#[CoversClass(Console::class)]
|
||||
class ConsoleTest extends TestCase
|
||||
{
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testStartHistory(mixed $actual, bool $expected): void
|
||||
{
|
||||
$console = new Console(['StartHistory' => $actual]);
|
||||
@ -30,7 +32,7 @@ class ConsoleTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testAlwaysExpand(mixed $actual, bool $expected): void
|
||||
{
|
||||
$console = new Console(['AlwaysExpand' => $actual]);
|
||||
@ -41,7 +43,7 @@ class ConsoleTest extends TestCase
|
||||
$this->assertSame($expected, $consoleArray['AlwaysExpand']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testCurrentQuery(mixed $actual, bool $expected): void
|
||||
{
|
||||
$console = new Console(['CurrentQuery' => $actual]);
|
||||
@ -61,7 +63,7 @@ class ConsoleTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testEnterExecutes(mixed $actual, bool $expected): void
|
||||
{
|
||||
$console = new Console(['EnterExecutes' => $actual]);
|
||||
@ -72,7 +74,7 @@ class ConsoleTest extends TestCase
|
||||
$this->assertSame($expected, $consoleArray['EnterExecutes']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testDarkTheme(mixed $actual, bool $expected): void
|
||||
{
|
||||
$console = new Console(['DarkTheme' => $actual]);
|
||||
@ -83,7 +85,7 @@ class ConsoleTest extends TestCase
|
||||
$this->assertSame($expected, $consoleArray['DarkTheme']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForModeProvider */
|
||||
#[DataProvider('valuesForModeProvider')]
|
||||
public function testMode(mixed $actual, string $expected): void
|
||||
{
|
||||
$console = new Console(['Mode' => $actual]);
|
||||
@ -104,7 +106,7 @@ class ConsoleTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'info'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForHeightProvider */
|
||||
#[DataProvider('valuesForHeightProvider')]
|
||||
public function testHeight(mixed $actual, int $expected): void
|
||||
{
|
||||
$console = new Console(['Height' => $actual]);
|
||||
@ -124,7 +126,7 @@ class ConsoleTest extends TestCase
|
||||
yield 'invalid value' => [0, 92];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testGroupQueries(mixed $actual, bool $expected): void
|
||||
{
|
||||
$console = new Console(['GroupQueries' => $actual]);
|
||||
@ -135,7 +137,7 @@ class ConsoleTest extends TestCase
|
||||
$this->assertSame($expected, $consoleArray['GroupQueries']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForOrderByProvider */
|
||||
#[DataProvider('valuesForOrderByProvider')]
|
||||
public function testOrderBy(mixed $actual, string $expected): void
|
||||
{
|
||||
$console = new Console(['OrderBy' => $actual]);
|
||||
@ -156,7 +158,7 @@ class ConsoleTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'exec'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForOrderProvider */
|
||||
#[DataProvider('valuesForOrderProvider')]
|
||||
public function testOrder(mixed $actual, string $expected): void
|
||||
{
|
||||
$console = new Console(['Order' => $actual]);
|
||||
|
||||
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\Debug;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\Debug */
|
||||
#[CoversClass(Debug::class)]
|
||||
class DebugTest extends TestCase
|
||||
{
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSql(mixed $actual, bool $expected): void
|
||||
{
|
||||
$debug = new Debug(['sql' => $actual]);
|
||||
@ -20,7 +22,7 @@ class DebugTest extends TestCase
|
||||
$this->assertSame($expected, $debugArray['sql']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqllog(mixed $actual, bool $expected): void
|
||||
{
|
||||
$debug = new Debug(['sqllog' => $actual]);
|
||||
@ -30,7 +32,7 @@ class DebugTest extends TestCase
|
||||
$this->assertSame($expected, $debugArray['sqllog']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testDemo(mixed $actual, bool $expected): void
|
||||
{
|
||||
$debug = new Debug(['demo' => $actual]);
|
||||
@ -40,7 +42,7 @@ class DebugTest extends TestCase
|
||||
$this->assertSame($expected, $debugArray['demo']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSimple2fa(mixed $actual, bool $expected): void
|
||||
{
|
||||
$debug = new Debug(['simple2fa' => $actual]);
|
||||
|
||||
@ -5,14 +5,15 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\Export;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\Export */
|
||||
#[CoversClass(Export::class)]
|
||||
class ExportTest extends TestCase
|
||||
{
|
||||
/** @dataProvider valuesForFormatProvider */
|
||||
#[DataProvider('valuesForFormatProvider')]
|
||||
public function testFormat(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['format' => $actual]);
|
||||
@ -42,7 +43,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'sql'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForMethodProvider */
|
||||
#[DataProvider('valuesForMethodProvider')]
|
||||
public function testMethod(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['method' => $actual]);
|
||||
@ -62,7 +63,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'quick'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCompressionProvider */
|
||||
#[DataProvider('valuesForCompressionProvider')]
|
||||
public function testCompression(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['compression' => $actual]);
|
||||
@ -82,7 +83,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'none'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testLockTables(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['lock_tables' => $actual]);
|
||||
@ -101,7 +102,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testAsSeparateFiles(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['as_separate_files' => $actual]);
|
||||
@ -111,7 +112,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['as_separate_files']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testAsfile(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['asfile' => $actual]);
|
||||
@ -130,7 +131,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCharsetProvider */
|
||||
#[DataProvider('valuesForCharsetProvider')]
|
||||
public function testCharset(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['charset' => $actual]);
|
||||
@ -149,7 +150,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testOnserver(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['onserver' => $actual]);
|
||||
@ -159,7 +160,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['onserver']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testOnserverOverwrite(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['onserver_overwrite' => $actual]);
|
||||
@ -169,7 +170,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['onserver_overwrite']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testQuickExportOnserver(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['quick_export_onserver' => $actual]);
|
||||
@ -179,7 +180,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['quick_export_onserver']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testQuickExportOnserverOverwrite(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['quick_export_onserver_overwrite' => $actual]);
|
||||
@ -189,7 +190,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['quick_export_onserver_overwrite']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testRememberFileTemplate(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['remember_file_template' => $actual]);
|
||||
@ -199,7 +200,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['remember_file_template']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForFileTemplateTableProvider */
|
||||
#[DataProvider('valuesForFileTemplateTableProvider')]
|
||||
public function testFileTemplateTable(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['file_template_table' => $actual]);
|
||||
@ -218,7 +219,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForFileTemplateDatabaseProvider */
|
||||
#[DataProvider('valuesForFileTemplateDatabaseProvider')]
|
||||
public function testFileTemplateDatabase(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['file_template_database' => $actual]);
|
||||
@ -237,7 +238,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForFileTemplateServerProvider */
|
||||
#[DataProvider('valuesForFileTemplateServerProvider')]
|
||||
public function testFileTemplateServer(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['file_template_server' => $actual]);
|
||||
@ -256,7 +257,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testCodegenStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['codegen_structure_or_data' => $actual]);
|
||||
@ -276,7 +277,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'data'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCodegenFormatProvider */
|
||||
#[DataProvider('valuesForCodegenFormatProvider')]
|
||||
public function testCodegenFormat(mixed $actual, int $expected): void
|
||||
{
|
||||
$export = new Export(['codegen_format' => $actual]);
|
||||
@ -297,7 +298,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value 2' => [2, 0];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testOdsColumns(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['ods_columns' => $actual]);
|
||||
@ -307,7 +308,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['ods_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForOdsNullProvider */
|
||||
#[DataProvider('valuesForOdsNullProvider')]
|
||||
public function testOdsNull(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['ods_null' => $actual]);
|
||||
@ -326,7 +327,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultStructureOrDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultStructureOrDataProvider')]
|
||||
public function testOdtStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['odt_structure_or_data' => $actual]);
|
||||
@ -346,7 +347,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'structure_and_data'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testOdtColumns(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['odt_columns' => $actual]);
|
||||
@ -356,7 +357,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['odt_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testOdtRelation(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['odt_relation' => $actual]);
|
||||
@ -366,7 +367,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['odt_relation']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testOdtComments(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['odt_comments' => $actual]);
|
||||
@ -376,7 +377,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['odt_comments']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testOdtMime(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['odt_mime' => $actual]);
|
||||
@ -386,7 +387,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['odt_mime']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForOdtNullProvider */
|
||||
#[DataProvider('valuesForOdtNullProvider')]
|
||||
public function testOdtNull(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['odt_null' => $actual]);
|
||||
@ -405,7 +406,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultStructureOrDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultStructureOrDataProvider')]
|
||||
public function testHtmlwordStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['htmlword_structure_or_data' => $actual]);
|
||||
@ -415,7 +416,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['htmlword_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testHtmlwordColumns(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['htmlword_columns' => $actual]);
|
||||
@ -425,7 +426,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['htmlword_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForHtmlwordNullProvider */
|
||||
#[DataProvider('valuesForHtmlwordNullProvider')]
|
||||
public function testHtmlwordNull(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['htmlword_null' => $actual]);
|
||||
@ -444,7 +445,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultStructureOrDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultStructureOrDataProvider')]
|
||||
public function testTexytextStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['texytext_structure_or_data' => $actual]);
|
||||
@ -454,7 +455,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['texytext_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testTexytextColumns(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['texytext_columns' => $actual]);
|
||||
@ -464,7 +465,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['texytext_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForTexytextNullProvider */
|
||||
#[DataProvider('valuesForTexytextNullProvider')]
|
||||
public function testTexytextNull(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['texytext_null' => $actual]);
|
||||
@ -483,7 +484,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testCsvColumns(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['csv_columns' => $actual]);
|
||||
@ -493,7 +494,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['csv_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testCsvStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['csv_structure_or_data' => $actual]);
|
||||
@ -503,7 +504,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['csv_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvNullProvider */
|
||||
#[DataProvider('valuesForCsvNullProvider')]
|
||||
public function testCsvNull(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['csv_null' => $actual]);
|
||||
@ -522,7 +523,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvSeparatorProvider */
|
||||
#[DataProvider('valuesForCsvSeparatorProvider')]
|
||||
public function testCsvSeparator(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['csv_separator' => $actual]);
|
||||
@ -541,7 +542,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvEnclosedProvider */
|
||||
#[DataProvider('valuesForCsvEnclosedProvider')]
|
||||
public function testCsvEnclosed(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['csv_enclosed' => $actual]);
|
||||
@ -560,7 +561,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvEscapedProvider */
|
||||
#[DataProvider('valuesForCsvEscapedProvider')]
|
||||
public function testCsvEscaped(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['csv_escaped' => $actual]);
|
||||
@ -579,7 +580,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvTerminatedProvider */
|
||||
#[DataProvider('valuesForCsvTerminatedProvider')]
|
||||
public function testCsvTerminated(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['csv_terminated' => $actual]);
|
||||
@ -598,7 +599,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testCsvRemoveCRLF(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['csv_removeCRLF' => $actual]);
|
||||
@ -608,7 +609,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['csv_removeCRLF']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testExcelColumns(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['excel_columns' => $actual]);
|
||||
@ -618,7 +619,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['excel_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForExcelNullProvider */
|
||||
#[DataProvider('valuesForExcelNullProvider')]
|
||||
public function testExcelNull(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['excel_null' => $actual]);
|
||||
@ -637,7 +638,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForExcelEditionProvider */
|
||||
#[DataProvider('valuesForExcelEditionProvider')]
|
||||
public function testExcelEdition(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['excel_edition' => $actual]);
|
||||
@ -657,7 +658,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'win'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testExcelRemoveCRLF(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['excel_removeCRLF' => $actual]);
|
||||
@ -667,7 +668,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['excel_removeCRLF']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testExcelStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['excel_structure_or_data' => $actual]);
|
||||
@ -677,7 +678,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['excel_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultStructureOrDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultStructureOrDataProvider')]
|
||||
public function testLatexStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_structure_or_data' => $actual]);
|
||||
@ -687,7 +688,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['latex_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testLatexColumns(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['latex_columns' => $actual]);
|
||||
@ -697,7 +698,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['latex_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testLatexRelation(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['latex_relation' => $actual]);
|
||||
@ -707,7 +708,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['latex_relation']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testLatexComments(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['latex_comments' => $actual]);
|
||||
@ -717,7 +718,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['latex_comments']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testLatexMime(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['latex_mime' => $actual]);
|
||||
@ -727,7 +728,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['latex_mime']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLatexNullProvider */
|
||||
#[DataProvider('valuesForLatexNullProvider')]
|
||||
public function testLatexNull(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_null' => $actual]);
|
||||
@ -746,7 +747,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testLatexCaption(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['latex_caption' => $actual]);
|
||||
@ -756,7 +757,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['latex_caption']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLatexStructureCaptionProvider */
|
||||
#[DataProvider('valuesForLatexStructureCaptionProvider')]
|
||||
public function testLatexStructureCaption(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_structure_caption' => $actual]);
|
||||
@ -775,7 +776,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLatexStructureContinuedCaptionProvider */
|
||||
#[DataProvider('valuesForLatexStructureContinuedCaptionProvider')]
|
||||
public function testLatexStructureContinuedCaption(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_structure_continued_caption' => $actual]);
|
||||
@ -794,7 +795,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLatexDataCaptionProvider */
|
||||
#[DataProvider('valuesForLatexDataCaptionProvider')]
|
||||
public function testLatexDataCaption(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_data_caption' => $actual]);
|
||||
@ -813,7 +814,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLatexDataContinuedCaptionProvider */
|
||||
#[DataProvider('valuesForLatexDataContinuedCaptionProvider')]
|
||||
public function testLatexDataContinuedCaption(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_data_continued_caption' => $actual]);
|
||||
@ -832,7 +833,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLatexDataLabelProvider */
|
||||
#[DataProvider('valuesForLatexDataLabelProvider')]
|
||||
public function testLatexDataLabel(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_data_label' => $actual]);
|
||||
@ -851,7 +852,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLatexStructureLabelProvider */
|
||||
#[DataProvider('valuesForLatexStructureLabelProvider')]
|
||||
public function testLatexStructureLabel(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['latex_structure_label' => $actual]);
|
||||
@ -870,7 +871,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testMediawikiStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['mediawiki_structure_or_data' => $actual]);
|
||||
@ -880,7 +881,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['mediawiki_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testMediawikiCaption(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['mediawiki_caption' => $actual]);
|
||||
@ -890,7 +891,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['mediawiki_caption']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testMediawikiHeaders(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['mediawiki_headers' => $actual]);
|
||||
@ -900,7 +901,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['mediawiki_headers']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testOdsStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['ods_structure_or_data' => $actual]);
|
||||
@ -910,7 +911,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['ods_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testPdfStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['pdf_structure_or_data' => $actual]);
|
||||
@ -920,7 +921,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['pdf_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testPhparrayStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['phparray_structure_or_data' => $actual]);
|
||||
@ -930,7 +931,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['phparray_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testJsonStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['json_structure_or_data' => $actual]);
|
||||
@ -940,7 +941,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['json_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testJsonPrettyPrint(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['json_pretty_print' => $actual]);
|
||||
@ -950,7 +951,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['json_pretty_print']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testJsonUnicode(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['json_unicode' => $actual]);
|
||||
@ -960,7 +961,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['json_unicode']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultStructureOrDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultStructureOrDataProvider')]
|
||||
public function testSqlStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['sql_structure_or_data' => $actual]);
|
||||
@ -970,7 +971,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSqlCompatibilityProvider */
|
||||
#[DataProvider('valuesForSqlCompatibilityProvider')]
|
||||
public function testSqlCompatibility(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['sql_compatibility' => $actual]);
|
||||
@ -997,7 +998,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'NONE'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlIncludeComments(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_include_comments' => $actual]);
|
||||
@ -1007,7 +1008,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_include_comments']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlDisableFk(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_disable_fk' => $actual]);
|
||||
@ -1017,7 +1018,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_disable_fk']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlViewsAsTables(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_views_as_tables' => $actual]);
|
||||
@ -1027,7 +1028,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_views_as_tables']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlMetadata(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_metadata' => $actual]);
|
||||
@ -1037,7 +1038,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_metadata']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlUseTransaction(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_use_transaction' => $actual]);
|
||||
@ -1047,7 +1048,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_use_transaction']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlCreateDatabase(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_create_database' => $actual]);
|
||||
@ -1057,7 +1058,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_create_database']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlDropDatabase(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_drop_database' => $actual]);
|
||||
@ -1067,7 +1068,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_drop_database']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlDropTable(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_drop_table' => $actual]);
|
||||
@ -1077,7 +1078,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_drop_table']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlIfNotExists(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_if_not_exists' => $actual]);
|
||||
@ -1087,7 +1088,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_if_not_exists']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlViewCurrentUser(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_view_current_user' => $actual]);
|
||||
@ -1097,7 +1098,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_view_current_user']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlOrReplaceView(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_or_replace_view' => $actual]);
|
||||
@ -1107,7 +1108,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_or_replace_view']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlProcedureFunction(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_procedure_function' => $actual]);
|
||||
@ -1117,7 +1118,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_procedure_function']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlCreateTable(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_create_table' => $actual]);
|
||||
@ -1127,7 +1128,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_create_table']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlCreateView(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_create_view' => $actual]);
|
||||
@ -1137,7 +1138,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_create_view']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlCreateTrigger(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_create_trigger' => $actual]);
|
||||
@ -1147,7 +1148,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_create_trigger']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlAutoIncrement(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_auto_increment' => $actual]);
|
||||
@ -1157,7 +1158,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_auto_increment']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlBackquotes(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_backquotes' => $actual]);
|
||||
@ -1167,7 +1168,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_backquotes']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlDates(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_dates' => $actual]);
|
||||
@ -1177,7 +1178,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_dates']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlRelation(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_relation' => $actual]);
|
||||
@ -1187,7 +1188,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_relation']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlTruncate(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_truncate' => $actual]);
|
||||
@ -1197,7 +1198,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_truncate']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlDelayed(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_delayed' => $actual]);
|
||||
@ -1207,7 +1208,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_delayed']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlIgnore(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_ignore' => $actual]);
|
||||
@ -1217,7 +1218,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_ignore']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlUtcTime(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_utc_time' => $actual]);
|
||||
@ -1227,7 +1228,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_utc_time']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlHexForBinary(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_hex_for_binary' => $actual]);
|
||||
@ -1237,7 +1238,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_hex_for_binary']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSqlTypeProvider */
|
||||
#[DataProvider('valuesForSqlTypeProvider')]
|
||||
public function testSqlType(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['sql_type' => $actual]);
|
||||
@ -1257,7 +1258,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'INSERT'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSqlMaxQuerySizeProvider */
|
||||
#[DataProvider('valuesForSqlMaxQuerySizeProvider')]
|
||||
public function testSqlMaxQuerySize(mixed $actual, int $expected): void
|
||||
{
|
||||
$export = new Export(['sql_max_query_size' => $actual]);
|
||||
@ -1276,7 +1277,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value' => [-1, 50000];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlMime(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['sql_mime' => $actual]);
|
||||
@ -1286,7 +1287,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['sql_mime']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSqlHeaderCommentProvider */
|
||||
#[DataProvider('valuesForSqlHeaderCommentProvider')]
|
||||
public function testSqlHeaderComment(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['sql_header_comment' => $actual]);
|
||||
@ -1305,7 +1306,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSqlInsertSyntaxProvider */
|
||||
#[DataProvider('valuesForSqlInsertSyntaxProvider')]
|
||||
public function testSqlInsertSyntax(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['sql_insert_syntax' => $actual]);
|
||||
@ -1327,7 +1328,7 @@ class ExportTest extends TestCase
|
||||
yield 'invalid value 2' => ['', 'both'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForPdfReportTitleProvider */
|
||||
#[DataProvider('valuesForPdfReportTitleProvider')]
|
||||
public function testPdfReportTitle(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['pdf_report_title' => $actual]);
|
||||
@ -1346,7 +1347,7 @@ class ExportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testXmlStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['xml_structure_or_data' => $actual]);
|
||||
@ -1356,7 +1357,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportStruc(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_struc' => $actual]);
|
||||
@ -1366,7 +1367,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_struc']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportEvents(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_events' => $actual]);
|
||||
@ -1376,7 +1377,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_events']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportFunctions(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_functions' => $actual]);
|
||||
@ -1386,7 +1387,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_functions']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportProcedures(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_procedures' => $actual]);
|
||||
@ -1396,7 +1397,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_procedures']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportTables(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_tables' => $actual]);
|
||||
@ -1406,7 +1407,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_tables']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportTriggers(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_triggers' => $actual]);
|
||||
@ -1416,7 +1417,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_triggers']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportViews(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_views' => $actual]);
|
||||
@ -1426,7 +1427,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_views']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testXmlExportContents(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['xml_export_contents' => $actual]);
|
||||
@ -1436,7 +1437,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['xml_export_contents']);
|
||||
}
|
||||
|
||||
/** @dataProvider structureOrDataWithDefaultDataProvider */
|
||||
#[DataProvider('structureOrDataWithDefaultDataProvider')]
|
||||
public function testYamlStructureOrData(mixed $actual, string $expected): void
|
||||
{
|
||||
$export = new Export(['yaml_structure_or_data' => $actual]);
|
||||
@ -1446,7 +1447,7 @@ class ExportTest extends TestCase
|
||||
$this->assertSame($expected, $exportArray['yaml_structure_or_data']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testRemoveDefinerFromDefinitions(mixed $actual, bool $expected): void
|
||||
{
|
||||
$export = new Export(['remove_definer_from_definitions' => $actual]);
|
||||
|
||||
@ -5,14 +5,15 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\Import;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\Import */
|
||||
#[CoversClass(Import::class)]
|
||||
class ImportTest extends TestCase
|
||||
{
|
||||
/** @dataProvider valuesForFormatProvider */
|
||||
#[DataProvider('valuesForFormatProvider')]
|
||||
public function testFormat(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['format' => $actual]);
|
||||
@ -33,7 +34,7 @@ class ImportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'sql'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCharsetProvider */
|
||||
#[DataProvider('valuesForCharsetProvider')]
|
||||
public function testCharset(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['charset' => $actual]);
|
||||
@ -52,7 +53,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testAllowInterrupt(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['allow_interrupt' => $actual]);
|
||||
@ -71,7 +72,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSkipQueriesProvider */
|
||||
#[DataProvider('valuesForSkipQueriesProvider')]
|
||||
public function testSkipQueries(mixed $actual, int $expected): void
|
||||
{
|
||||
$import = new Import(['skip_queries' => $actual]);
|
||||
@ -91,7 +92,7 @@ class ImportTest extends TestCase
|
||||
yield 'invalid value' => [-1, 0];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSqlCompatibilityProvider */
|
||||
#[DataProvider('valuesForSqlCompatibilityProvider')]
|
||||
public function testSqlCompatibility(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['sql_compatibility' => $actual]);
|
||||
@ -118,7 +119,7 @@ class ImportTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'NONE'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSqlNoAutoValueOnZero(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['sql_no_auto_value_on_zero' => $actual]);
|
||||
@ -128,7 +129,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['sql_no_auto_value_on_zero']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSqlReadAsMultibytes(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['sql_read_as_multibytes' => $actual]);
|
||||
@ -147,7 +148,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testCsvReplace(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['csv_replace' => $actual]);
|
||||
@ -157,7 +158,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['csv_replace']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testCsvIgnore(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['csv_ignore' => $actual]);
|
||||
@ -167,7 +168,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['csv_ignore']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvTerminatedProvider */
|
||||
#[DataProvider('valuesForCsvTerminatedProvider')]
|
||||
public function testCsvTerminated(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['csv_terminated' => $actual]);
|
||||
@ -186,7 +187,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvEnclosedProvider */
|
||||
#[DataProvider('valuesForCsvEnclosedProvider')]
|
||||
public function testCsvEnclosed(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['csv_enclosed' => $actual]);
|
||||
@ -205,7 +206,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvEscapedProvider */
|
||||
#[DataProvider('valuesForCsvEscapedProvider')]
|
||||
public function testCsvEscaped(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['csv_escaped' => $actual]);
|
||||
@ -224,7 +225,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvNewLineProvider */
|
||||
#[DataProvider('valuesForCsvNewLineProvider')]
|
||||
public function testCsvNewLine(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['csv_new_line' => $actual]);
|
||||
@ -243,7 +244,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForCsvColumnsProvider */
|
||||
#[DataProvider('valuesForCsvColumnsProvider')]
|
||||
public function testCsvColumns(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['csv_columns' => $actual]);
|
||||
@ -262,7 +263,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testCsvColNames(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['csv_col_names' => $actual]);
|
||||
@ -272,7 +273,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['csv_col_names']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testLdiReplace(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_replace' => $actual]);
|
||||
@ -282,7 +283,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['ldi_replace']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testLdiIgnore(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_ignore' => $actual]);
|
||||
@ -292,7 +293,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['ldi_ignore']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLdiTerminatedProvider */
|
||||
#[DataProvider('valuesForLdiTerminatedProvider')]
|
||||
public function testLdiTerminated(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_terminated' => $actual]);
|
||||
@ -311,7 +312,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLdiEnclosedProvider */
|
||||
#[DataProvider('valuesForLdiEnclosedProvider')]
|
||||
public function testLdiEnclosed(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_enclosed' => $actual]);
|
||||
@ -330,7 +331,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLdiEscapedProvider */
|
||||
#[DataProvider('valuesForLdiEscapedProvider')]
|
||||
public function testLdiEscaped(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_escaped' => $actual]);
|
||||
@ -349,7 +350,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLdiNewLineProvider */
|
||||
#[DataProvider('valuesForLdiNewLineProvider')]
|
||||
public function testLdiNewLine(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_new_line' => $actual]);
|
||||
@ -368,7 +369,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLdiColumnsProvider */
|
||||
#[DataProvider('valuesForLdiColumnsProvider')]
|
||||
public function testLdiColumns(mixed $actual, string $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_columns' => $actual]);
|
||||
@ -387,7 +388,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLdiLocalOptionProvider */
|
||||
#[DataProvider('valuesForLdiLocalOptionProvider')]
|
||||
public function testLdiLocalOption(mixed $actual, string|bool $expected): void
|
||||
{
|
||||
$import = new Import(['ldi_local_option' => $actual]);
|
||||
@ -407,7 +408,7 @@ class ImportTest extends TestCase
|
||||
yield 'valid value with type coercion' => ['1', true];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testOdsColNames(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['ods_col_names' => $actual]);
|
||||
@ -417,7 +418,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['ods_col_names']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testOdsEmptyRows(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['ods_empty_rows' => $actual]);
|
||||
@ -427,7 +428,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['ods_empty_rows']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testOdsRecognizePercentages(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['ods_recognize_percentages' => $actual]);
|
||||
@ -437,7 +438,7 @@ class ImportTest extends TestCase
|
||||
$this->assertSame($expected, $importArray['ods_recognize_percentages']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testOdsRecognizeCurrency(mixed $actual, bool $expected): void
|
||||
{
|
||||
$import = new Import(['ods_recognize_currency' => $actual]);
|
||||
|
||||
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\Schema;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
use function array_keys;
|
||||
use function array_merge;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\Schema */
|
||||
#[CoversClass(Schema::class)]
|
||||
class SchemaTest extends TestCase
|
||||
{
|
||||
/** @var array<string, bool|string> */
|
||||
@ -40,9 +42,8 @@ class SchemaTest extends TestCase
|
||||
/**
|
||||
* @param mixed[][] $values
|
||||
* @psalm-param (array{0: string, 1: mixed, 2: mixed})[] $values
|
||||
*
|
||||
* @dataProvider providerForTestConstructor
|
||||
*/
|
||||
#[DataProvider('providerForTestConstructor')]
|
||||
public function testConstructor(array $values): void
|
||||
{
|
||||
$actualValues = [];
|
||||
|
||||
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\Server;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\Server */
|
||||
#[CoversClass(Server::class)]
|
||||
class ServerTest extends TestCase
|
||||
{
|
||||
/** @dataProvider valuesForHostProvider */
|
||||
#[DataProvider('valuesForHostProvider')]
|
||||
public function testHost(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['host' => $actual]);
|
||||
@ -29,7 +31,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForPortProvider */
|
||||
#[DataProvider('valuesForPortProvider')]
|
||||
public function testPort(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['port' => $actual]);
|
||||
@ -48,7 +50,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSocketProvider */
|
||||
#[DataProvider('valuesForSocketProvider')]
|
||||
public function testSocket(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['socket' => $actual]);
|
||||
@ -67,7 +69,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSsl(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['ssl' => $actual]);
|
||||
@ -86,7 +88,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testSslKey(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['ssl_key' => $actual]);
|
||||
@ -105,7 +107,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testSslCert(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['ssl_cert' => $actual]);
|
||||
@ -115,7 +117,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['ssl_cert']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testSslCa(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['ssl_ca' => $actual]);
|
||||
@ -125,7 +127,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['ssl_ca']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testSslCaPath(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['ssl_ca_path' => $actual]);
|
||||
@ -135,7 +137,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['ssl_ca_path']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testSslCiphers(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['ssl_ciphers' => $actual]);
|
||||
@ -145,7 +147,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['ssl_ciphers']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testSslVerify(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['ssl_verify' => $actual]);
|
||||
@ -164,7 +166,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testCompress(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['compress' => $actual]);
|
||||
@ -174,7 +176,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['compress']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlHostProvider */
|
||||
#[DataProvider('valuesForControlHostProvider')]
|
||||
public function testControlHost(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['controlhost' => $actual]);
|
||||
@ -184,7 +186,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['controlhost']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlHostProvider */
|
||||
#[DataProvider('valuesForControlHostProvider')]
|
||||
public function testControlHost2(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['control_host' => $actual]);
|
||||
@ -203,7 +205,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlPortProvider */
|
||||
#[DataProvider('valuesForControlPortProvider')]
|
||||
public function testControlPort(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['controlport' => $actual]);
|
||||
@ -213,7 +215,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['controlport']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlPortProvider */
|
||||
#[DataProvider('valuesForControlPortProvider')]
|
||||
public function testControlPort2(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['control_port' => $actual]);
|
||||
@ -232,7 +234,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlUserProvider */
|
||||
#[DataProvider('valuesForControlUserProvider')]
|
||||
public function testControlUser(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['controluser' => $actual]);
|
||||
@ -242,7 +244,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['controluser']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlUserProvider */
|
||||
#[DataProvider('valuesForControlUserProvider')]
|
||||
public function testControlUser2(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['control_user' => $actual]);
|
||||
@ -261,7 +263,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlPassProvider */
|
||||
#[DataProvider('valuesForControlPassProvider')]
|
||||
public function testControlPass(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['controlpass' => $actual]);
|
||||
@ -271,7 +273,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['controlpass']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlPassProvider */
|
||||
#[DataProvider('valuesForControlPassProvider')]
|
||||
public function testControlPass2(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['control_pass' => $actual]);
|
||||
@ -281,7 +283,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['controlpass']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlPassProvider */
|
||||
#[DataProvider('valuesForControlPassProvider')]
|
||||
public function testControlPass3(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['control_password' => $actual]);
|
||||
@ -300,7 +302,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlSocketProvider */
|
||||
#[DataProvider('valuesForControlSocketProvider')]
|
||||
public function testControlSocket(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_socket' => $actual]);
|
||||
@ -319,7 +321,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlSslProvider */
|
||||
#[DataProvider('valuesForControlSslProvider')]
|
||||
public function testControlSsl(mixed $actual, bool|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_ssl' => $actual]);
|
||||
@ -338,7 +340,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testControlSslKey(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_ssl_key' => $actual]);
|
||||
@ -348,7 +350,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['control_ssl_key']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testControlSslCert(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_ssl_cert' => $actual]);
|
||||
@ -358,7 +360,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['control_ssl_cert']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testControlSslCa(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_ssl_ca' => $actual]);
|
||||
@ -368,7 +370,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['control_ssl_ca']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testControlSslCaPath(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_ssl_ca_path' => $actual]);
|
||||
@ -378,7 +380,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['control_ssl_ca_path']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSslOptionsProvider */
|
||||
#[DataProvider('valuesForSslOptionsProvider')]
|
||||
public function testControlSslCiphers(mixed $actual, string|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_ssl_ciphers' => $actual]);
|
||||
@ -388,7 +390,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['control_ssl_ciphers']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlSslVerifyProvider */
|
||||
#[DataProvider('valuesForControlSslVerifyProvider')]
|
||||
public function testControlSslVerify(mixed $actual, bool|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_ssl_verify' => $actual]);
|
||||
@ -407,7 +409,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlCompressProvider */
|
||||
#[DataProvider('valuesForControlCompressProvider')]
|
||||
public function testControlCompress(mixed $actual, bool|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_compress' => $actual]);
|
||||
@ -426,7 +428,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForControlHideConnectionErrorsProvider */
|
||||
#[DataProvider('valuesForControlHideConnectionErrorsProvider')]
|
||||
public function testControlHideConnectionErrors(mixed $actual, bool|null $expected): void
|
||||
{
|
||||
$server = new Server(['control_hide_connection_errors' => $actual]);
|
||||
@ -445,7 +447,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForAuthTypeProvider */
|
||||
#[DataProvider('valuesForAuthTypeProvider')]
|
||||
public function testAuthType(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['auth_type' => $actual]);
|
||||
@ -466,7 +468,7 @@ class ServerTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', 'cookie'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForAuthHttpRealmProvider */
|
||||
#[DataProvider('valuesForAuthHttpRealmProvider')]
|
||||
public function testAuthHttpRealm(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['auth_http_realm' => $actual]);
|
||||
@ -485,7 +487,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForUserProvider */
|
||||
#[DataProvider('valuesForUserProvider')]
|
||||
public function testUser(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['user' => $actual]);
|
||||
@ -504,7 +506,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForPasswordProvider */
|
||||
#[DataProvider('valuesForPasswordProvider')]
|
||||
public function testPassword(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['password' => $actual]);
|
||||
@ -523,7 +525,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSignonSessionProvider */
|
||||
#[DataProvider('valuesForSignonSessionProvider')]
|
||||
public function testSignonSession(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['SignonSession' => $actual]);
|
||||
@ -542,11 +544,8 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, int|string|bool> $expected
|
||||
*
|
||||
* @dataProvider valuesForSignonCookieParamsProvider
|
||||
*/
|
||||
/** @param array<string, int|string|bool> $expected */
|
||||
#[DataProvider('valuesForSignonCookieParamsProvider')]
|
||||
public function testSignonCookieParams(mixed $actual, array $expected): void
|
||||
{
|
||||
$server = new Server(['SignonCookieParams' => $actual]);
|
||||
@ -616,7 +615,7 @@ class ServerTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSignonScriptProvider */
|
||||
#[DataProvider('valuesForSignonScriptProvider')]
|
||||
public function testSignonScript(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['SignonScript' => $actual]);
|
||||
@ -635,7 +634,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSignonURLProvider */
|
||||
#[DataProvider('valuesForSignonURLProvider')]
|
||||
public function testSignonURL(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['SignonURL' => $actual]);
|
||||
@ -654,7 +653,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLogoutURLProvider */
|
||||
#[DataProvider('valuesForLogoutURLProvider')]
|
||||
public function testLogoutURL(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['LogoutURL' => $actual]);
|
||||
@ -673,11 +672,8 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|string[] $expected
|
||||
*
|
||||
* @dataProvider valuesForOnlyDbProvider
|
||||
*/
|
||||
/** @param string|string[] $expected */
|
||||
#[DataProvider('valuesForOnlyDbProvider')]
|
||||
public function testOnlyDb(mixed $actual, string|array $expected): void
|
||||
{
|
||||
$server = new Server(['only_db' => $actual]);
|
||||
@ -697,7 +693,7 @@ class ServerTest extends TestCase
|
||||
yield 'invalid value' => [[], ''];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForHideDbProvider */
|
||||
#[DataProvider('valuesForHideDbProvider')]
|
||||
public function testHideDb(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['hide_db' => $actual]);
|
||||
@ -716,7 +712,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForVerboseProvider */
|
||||
#[DataProvider('valuesForVerboseProvider')]
|
||||
public function testVerbose(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['verbose' => $actual]);
|
||||
@ -735,7 +731,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForPmaDbProvider */
|
||||
#[DataProvider('valuesForPmaDbProvider')]
|
||||
public function testPmaDb(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['pmadb' => $actual]);
|
||||
@ -754,7 +750,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testBookmarkTable(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['bookmarktable' => $actual]);
|
||||
@ -774,7 +770,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [true, '1'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testRelation(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['relation' => $actual]);
|
||||
@ -784,7 +780,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['relation']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testTableInfo(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['table_info' => $actual]);
|
||||
@ -794,7 +790,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['table_info']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testPdfPages(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['pdf_pages' => $actual]);
|
||||
@ -804,7 +800,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['pdf_pages']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testColumnInfo(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['column_info' => $actual]);
|
||||
@ -814,7 +810,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['column_info']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testHistory(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['history' => $actual]);
|
||||
@ -824,7 +820,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['history']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testRecent(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['recent' => $actual]);
|
||||
@ -834,7 +830,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['recent']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testFavorite(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['favorite' => $actual]);
|
||||
@ -844,7 +840,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['favorite']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testTableUiPrefs(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['table_uiprefs' => $actual]);
|
||||
@ -854,7 +850,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['table_uiprefs']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testTracking(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['tracking' => $actual]);
|
||||
@ -864,7 +860,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['tracking']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testUserConfig(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['userconfig' => $actual]);
|
||||
@ -874,7 +870,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['userconfig']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testUsers(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['users' => $actual]);
|
||||
@ -884,7 +880,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['users']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testUserGroups(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['usergroups' => $actual]);
|
||||
@ -894,7 +890,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['usergroups']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testNavigationHiding(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['navigationhiding' => $actual]);
|
||||
@ -904,7 +900,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['navigationhiding']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testSavedSearches(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['savedsearches' => $actual]);
|
||||
@ -914,7 +910,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['savedsearches']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testCentralColumns(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['central_columns' => $actual]);
|
||||
@ -924,7 +920,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['central_columns']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testDesignerSettings(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['designer_settings' => $actual]);
|
||||
@ -934,7 +930,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['designer_settings']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForConfigStorageTablesProvider */
|
||||
#[DataProvider('valuesForConfigStorageTablesProvider')]
|
||||
public function testExportTemplates(mixed $actual, string|false $expected): void
|
||||
{
|
||||
$server = new Server(['export_templates' => $actual]);
|
||||
@ -944,7 +940,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['export_templates']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForMaxTableUiPrefsProvider */
|
||||
#[DataProvider('valuesForMaxTableUiPrefsProvider')]
|
||||
public function testMaxTableUiPrefs(mixed $actual, int $expected): void
|
||||
{
|
||||
$server = new Server(['MaxTableUiprefs' => $actual]);
|
||||
@ -964,7 +960,7 @@ class ServerTest extends TestCase
|
||||
yield 'invalid value 2' => [0, 100];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSessionTimeZoneProvider */
|
||||
#[DataProvider('valuesForSessionTimeZoneProvider')]
|
||||
public function testSessionTimeZone(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['SessionTimeZone' => $actual]);
|
||||
@ -983,7 +979,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testAllowRoot(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['AllowRoot' => $actual]);
|
||||
@ -993,7 +989,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['AllowRoot']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testAllowNoPassword(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['AllowNoPassword' => $actual]);
|
||||
@ -1003,11 +999,8 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['AllowNoPassword']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string|string[]> $expected
|
||||
*
|
||||
* @dataProvider valuesForAllowDenyProvider
|
||||
*/
|
||||
/** @param array<string, string|string[]> $expected */
|
||||
#[DataProvider('valuesForAllowDenyProvider')]
|
||||
public function testAllowDeny(mixed $actual, array $expected): void
|
||||
{
|
||||
$server = new Server(['AllowDeny' => $actual]);
|
||||
@ -1038,7 +1031,7 @@ class ServerTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testDisableIS(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['DisableIS' => $actual]);
|
||||
@ -1048,7 +1041,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['DisableIS']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testTrackingVersionAutoCreate(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['tracking_version_auto_create' => $actual]);
|
||||
@ -1058,7 +1051,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['tracking_version_auto_create']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForTrackingDefaultStatementsProvider */
|
||||
#[DataProvider('valuesForTrackingDefaultStatementsProvider')]
|
||||
public function testTrackingDefaultStatements(mixed $actual, string $expected): void
|
||||
{
|
||||
$server = new Server(['tracking_default_statements' => $actual]);
|
||||
@ -1082,7 +1075,7 @@ class ServerTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testTrackingAddDropView(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['tracking_add_drop_view' => $actual]);
|
||||
@ -1092,7 +1085,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['tracking_add_drop_view']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testTrackingAddDropTable(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['tracking_add_drop_table' => $actual]);
|
||||
@ -1102,7 +1095,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['tracking_add_drop_table']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testTrackingAddDropDatabase(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['tracking_add_drop_database' => $actual]);
|
||||
@ -1112,7 +1105,7 @@ class ServerTest extends TestCase
|
||||
$this->assertSame($expected, $serverArray['tracking_add_drop_database']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testHideConnectionErrors(mixed $actual, bool $expected): void
|
||||
{
|
||||
$server = new Server(['hide_connection_errors' => $actual]);
|
||||
|
||||
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\SqlQueryBox;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\SqlQueryBox */
|
||||
#[CoversClass(SqlQueryBox::class)]
|
||||
class SqlQueryBoxTest extends TestCase
|
||||
{
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testEdit(mixed $actual, bool $expected): void
|
||||
{
|
||||
$sqlQueryBox = new SqlQueryBox(['Edit' => $actual]);
|
||||
@ -21,7 +23,7 @@ class SqlQueryBoxTest extends TestCase
|
||||
$this->assertSame($expected, $sqlQueryBoxArray['Edit']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testExplain(mixed $actual, bool $expected): void
|
||||
{
|
||||
$sqlQueryBox = new SqlQueryBox(['Explain' => $actual]);
|
||||
@ -32,7 +34,7 @@ class SqlQueryBoxTest extends TestCase
|
||||
$this->assertSame($expected, $sqlQueryBoxArray['Explain']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testShowAsPHP(mixed $actual, bool $expected): void
|
||||
{
|
||||
$sqlQueryBox = new SqlQueryBox(['ShowAsPHP' => $actual]);
|
||||
@ -43,7 +45,7 @@ class SqlQueryBoxTest extends TestCase
|
||||
$this->assertSame($expected, $sqlQueryBoxArray['ShowAsPHP']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testRefresh(mixed $actual, bool $expected): void
|
||||
{
|
||||
$sqlQueryBox = new SqlQueryBox(['Refresh' => $actual]);
|
||||
|
||||
@ -5,16 +5,15 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Config\Settings;
|
||||
|
||||
use PhpMyAdmin\Config\Settings\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/** @covers \PhpMyAdmin\Config\Settings\Transformations */
|
||||
#[CoversClass(Transformations::class)]
|
||||
class TransformationsTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @param array<int, int|string> $expected
|
||||
*
|
||||
* @dataProvider valuesForSubstringProvider
|
||||
*/
|
||||
/** @param array<int, int|string> $expected */
|
||||
#[DataProvider('valuesForSubstringProvider')]
|
||||
public function testSubstring(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['Substring' => $actual]);
|
||||
@ -39,11 +38,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', [0, 'all', '…']];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, string> $expected
|
||||
*
|
||||
* @dataProvider valuesForBool2TextProvider
|
||||
*/
|
||||
/** @param array<int, string> $expected */
|
||||
#[DataProvider('valuesForBool2TextProvider')]
|
||||
public function testBool2Text(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['Bool2Text' => $actual]);
|
||||
@ -66,11 +62,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid value' => ['invalid', ['T', 'F']];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, int|string> $expected
|
||||
*
|
||||
* @dataProvider valuesForExternalProvider
|
||||
*/
|
||||
/** @param array<int, int|string> $expected */
|
||||
#[DataProvider('valuesForExternalProvider')]
|
||||
public function testExternal(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['External' => $actual]);
|
||||
@ -96,11 +89,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid values' => ['invalid', [0, '-f /dev/null -i -wrap -q', 1, 1]];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, string> $expected
|
||||
*
|
||||
* @dataProvider valuesForPreApPendProvider
|
||||
*/
|
||||
/** @param array<int, string> $expected */
|
||||
#[DataProvider('valuesForPreApPendProvider')]
|
||||
public function testPreApPend(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['PreApPend' => $actual]);
|
||||
@ -123,11 +113,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid values' => ['invalid', ['', '']];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, int> $expected
|
||||
*
|
||||
* @dataProvider valuesForHexProvider
|
||||
*/
|
||||
/** @param array<int, int> $expected */
|
||||
#[DataProvider('valuesForHexProvider')]
|
||||
public function testHex(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['Hex' => $actual]);
|
||||
@ -149,11 +136,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid values' => ['invalid', [2]];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, int|string> $expected
|
||||
*
|
||||
* @dataProvider valuesForDateFormatProvider
|
||||
*/
|
||||
/** @param array<int, int|string> $expected */
|
||||
#[DataProvider('valuesForDateFormatProvider')]
|
||||
public function testDateFormat(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['DateFormat' => $actual]);
|
||||
@ -178,11 +162,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid values' => ['invalid', [0, '', 'local']];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int|string, int|string|array<string>|null> $expected
|
||||
*
|
||||
* @dataProvider valuesForInlineProvider
|
||||
*/
|
||||
/** @param array<int|string, int|string|array<string>|null> $expected */
|
||||
#[DataProvider('valuesForInlineProvider')]
|
||||
public function testInline(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['Inline' => $actual]);
|
||||
@ -214,11 +195,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid values' => ['invalid', [100, 100, 'wrapper_link' => null, 'wrapper_params' => []]];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, int|string|null> $expected
|
||||
*
|
||||
* @dataProvider valuesForTextImageLinkProvider
|
||||
*/
|
||||
/** @param array<int, int|string|null> $expected */
|
||||
#[DataProvider('valuesForTextImageLinkProvider')]
|
||||
public function testTextImageLink(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['TextImageLink' => $actual]);
|
||||
@ -243,11 +221,8 @@ class TransformationsTest extends TestCase
|
||||
yield 'invalid values' => ['invalid', [null, 100, 50]];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, string|bool|null> $expected
|
||||
*
|
||||
* @dataProvider valuesForTextLinkProvider
|
||||
*/
|
||||
/** @param array<int, string|bool|null> $expected */
|
||||
#[DataProvider('valuesForTextLinkProvider')]
|
||||
public function testTextLink(mixed $actual, array $expected): void
|
||||
{
|
||||
$transformations = new Transformations(['TextLink' => $actual]);
|
||||
|
||||
@ -13,6 +13,8 @@ use PhpMyAdmin\Config\Settings\Schema;
|
||||
use PhpMyAdmin\Config\Settings\Server;
|
||||
use PhpMyAdmin\Config\Settings\SqlQueryBox;
|
||||
use PhpMyAdmin\Config\Settings\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
use function array_keys;
|
||||
@ -23,18 +25,15 @@ use const DIRECTORY_SEPARATOR;
|
||||
use const ROOT_PATH;
|
||||
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps, Generic.Files.LineLength.TooLong
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Config\Settings
|
||||
* @covers \PhpMyAdmin\Config\Settings\Console
|
||||
* @covers \PhpMyAdmin\Config\Settings\Debug
|
||||
* @covers \PhpMyAdmin\Config\Settings\Export
|
||||
* @covers \PhpMyAdmin\Config\Settings\Import
|
||||
* @covers \PhpMyAdmin\Config\Settings\Schema
|
||||
* @covers \PhpMyAdmin\Config\Settings\Server
|
||||
* @covers \PhpMyAdmin\Config\Settings\SqlQueryBox
|
||||
* @covers \PhpMyAdmin\Config\Settings\Transformations
|
||||
*/
|
||||
#[CoversClass(Settings::class)]
|
||||
#[CoversClass(Console::class)]
|
||||
#[CoversClass(Debug::class)]
|
||||
#[CoversClass(Export::class)]
|
||||
#[CoversClass(Import::class)]
|
||||
#[CoversClass(Schema::class)]
|
||||
#[CoversClass(Server::class)]
|
||||
#[CoversClass(SqlQueryBox::class)]
|
||||
#[CoversClass(Transformations::class)]
|
||||
class SettingsTest extends TestCase
|
||||
{
|
||||
/** @var array<string, array|bool|int|string|null> */
|
||||
@ -263,9 +262,8 @@ class SettingsTest extends TestCase
|
||||
/**
|
||||
* @param mixed[][] $values
|
||||
* @psalm-param (array{0: string, 1: mixed, 2: mixed})[] $values
|
||||
*
|
||||
* @dataProvider providerForTestConstructor
|
||||
*/
|
||||
#[DataProvider('providerForTestConstructor')]
|
||||
public function testConstructor(array $values): void
|
||||
{
|
||||
$actualValues = [];
|
||||
@ -1006,7 +1004,7 @@ class SettingsTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForPmaAbsoluteUriProvider */
|
||||
#[DataProvider('valuesForPmaAbsoluteUriProvider')]
|
||||
public function testPmaAbsoluteUri(mixed $actual, string $expected): void
|
||||
{
|
||||
$settings = new Settings(['PmaAbsoluteUri' => $actual]);
|
||||
@ -1025,7 +1023,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForAuthLogProvider */
|
||||
#[DataProvider('valuesForAuthLogProvider')]
|
||||
public function testAuthLog(mixed $actual, string $expected): void
|
||||
{
|
||||
$settings = new Settings(['AuthLog' => $actual]);
|
||||
@ -1044,7 +1042,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testAuthLogSuccess(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['AuthLogSuccess' => $actual]);
|
||||
@ -1054,7 +1052,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['AuthLogSuccess']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testPmaNoRelationDisableWarning(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['PmaNoRelation_DisableWarning' => $actual]);
|
||||
@ -1064,7 +1062,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['PmaNoRelation_DisableWarning']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testSuhosinDisableWarning(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['SuhosinDisableWarning' => $actual]);
|
||||
@ -1074,7 +1072,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['SuhosinDisableWarning']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testLoginCookieValidityDisableWarning(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['LoginCookieValidityDisableWarning' => $actual]);
|
||||
@ -1084,7 +1082,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['LoginCookieValidityDisableWarning']);
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testReservedWordDisableWarning(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['ReservedWordDisableWarning' => $actual]);
|
||||
@ -1094,7 +1092,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['ReservedWordDisableWarning']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForTranslationWarningThresholdProvider */
|
||||
#[DataProvider('valuesForTranslationWarningThresholdProvider')]
|
||||
public function testTranslationWarningThreshold(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['TranslationWarningThreshold' => $actual]);
|
||||
@ -1114,7 +1112,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value 2' => [101, 100];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForAllowThirdPartyFramingProvider */
|
||||
#[DataProvider('valuesForAllowThirdPartyFramingProvider')]
|
||||
public function testAllowThirdPartyFraming(mixed $actual, bool|string $expected): void
|
||||
{
|
||||
$settings = new Settings(['AllowThirdPartyFraming' => $actual]);
|
||||
@ -1134,7 +1132,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForBlowfishSecretProvider */
|
||||
#[DataProvider('valuesForBlowfishSecretProvider')]
|
||||
public function testBlowfishSecret(mixed $actual, string $expected): void
|
||||
{
|
||||
$settings = new Settings(['blowfish_secret' => $actual]);
|
||||
@ -1153,11 +1151,8 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, Server> $expected
|
||||
*
|
||||
* @dataProvider valuesForServersProvider
|
||||
*/
|
||||
/** @param array<int, Server> $expected */
|
||||
#[DataProvider('valuesForServersProvider')]
|
||||
public function testServers(mixed $actual, array $expected): void
|
||||
{
|
||||
$settings = new Settings(['Servers' => $actual]);
|
||||
@ -1186,7 +1181,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value 3' => [[0 => []], [1 => $server]];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForServerDefaultProvider */
|
||||
#[DataProvider('valuesForServerDefaultProvider')]
|
||||
public function testServerDefault(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['ServerDefault' => $actual]);
|
||||
@ -1205,7 +1200,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [-1, 1];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testVersionCheck(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['VersionCheck' => $actual]);
|
||||
@ -1215,7 +1210,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['VersionCheck']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForProxyUrlProvider */
|
||||
#[DataProvider('valuesForProxyUrlProvider')]
|
||||
public function testProxyUrl(mixed $actual, string $expected): void
|
||||
{
|
||||
$settings = new Settings(['ProxyUrl' => $actual]);
|
||||
@ -1234,7 +1229,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForProxyUserProvider */
|
||||
#[DataProvider('valuesForProxyUserProvider')]
|
||||
public function testProxyUser(mixed $actual, string $expected): void
|
||||
{
|
||||
$settings = new Settings(['ProxyUser' => $actual]);
|
||||
@ -1253,7 +1248,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForProxyPassProvider */
|
||||
#[DataProvider('valuesForProxyPassProvider')]
|
||||
public function testProxyPass(mixed $actual, string $expected): void
|
||||
{
|
||||
$settings = new Settings(['ProxyPass' => $actual]);
|
||||
@ -1272,7 +1267,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForMaxDbListProvider */
|
||||
#[DataProvider('valuesForMaxDbListProvider')]
|
||||
public function testMaxDbList(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['MaxDbList' => $actual]);
|
||||
@ -1291,7 +1286,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [0, 100];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForMaxTableListProvider */
|
||||
#[DataProvider('valuesForMaxTableListProvider')]
|
||||
public function testMaxTableList(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['MaxTableList' => $actual]);
|
||||
@ -1310,7 +1305,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [0, 250];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testShowHint(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['ShowHint' => $actual]);
|
||||
@ -1320,7 +1315,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['ShowHint']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForMaxCharactersInDisplayedSQLProvider */
|
||||
#[DataProvider('valuesForMaxCharactersInDisplayedSQLProvider')]
|
||||
public function testMaxCharactersInDisplayedSQL(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['MaxCharactersInDisplayedSQL' => $actual]);
|
||||
@ -1339,7 +1334,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [0, 1000];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForOBGzipProvider */
|
||||
#[DataProvider('valuesForOBGzipProvider')]
|
||||
public function testOBGzip(mixed $actual, string|bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['OBGzip' => $actual]);
|
||||
@ -1359,7 +1354,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testPersistentConnections(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['PersistentConnections' => $actual]);
|
||||
@ -1369,7 +1364,7 @@ class SettingsTest extends TestCase
|
||||
$this->assertSame($expected, $settingsArray['PersistentConnections']);
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForExecTimeLimitProvider */
|
||||
#[DataProvider('valuesForExecTimeLimitProvider')]
|
||||
public function testExecTimeLimit(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['ExecTimeLimit' => $actual]);
|
||||
@ -1388,7 +1383,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [-1, 300];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForSessionSavePathProvider */
|
||||
#[DataProvider('valuesForSessionSavePathProvider')]
|
||||
public function testSessionSavePath(mixed $actual, string $expected): void
|
||||
{
|
||||
$settings = new Settings(['SessionSavePath' => $actual]);
|
||||
@ -1407,7 +1402,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1234, '1234'];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultFalseProvider */
|
||||
#[DataProvider('booleanWithDefaultFalseProvider')]
|
||||
public function testShowAll(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['ShowAll' => $actual]);
|
||||
@ -1426,7 +1421,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [1, true];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForMaxRowsProvider */
|
||||
#[DataProvider('valuesForMaxRowsProvider')]
|
||||
public function testMaxRows(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['MaxRows' => $actual]);
|
||||
@ -1445,7 +1440,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [0, 25];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForLimitCharsProvider */
|
||||
#[DataProvider('valuesForLimitCharsProvider')]
|
||||
public function testLimitChars(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['LimitChars' => $actual]);
|
||||
@ -1464,7 +1459,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [0, 50];
|
||||
}
|
||||
|
||||
/** @dataProvider valuesForRepeatCellsProvider */
|
||||
#[DataProvider('valuesForRepeatCellsProvider')]
|
||||
public function testRepeatCells(mixed $actual, int $expected): void
|
||||
{
|
||||
$settings = new Settings(['RepeatCells' => $actual]);
|
||||
@ -1483,7 +1478,7 @@ class SettingsTest extends TestCase
|
||||
yield 'invalid value' => [-1, 100];
|
||||
}
|
||||
|
||||
/** @dataProvider booleanWithDefaultTrueProvider */
|
||||
#[DataProvider('booleanWithDefaultTrueProvider')]
|
||||
public function testZeroConf(mixed $actual, bool $expected): void
|
||||
{
|
||||
$settings = new Settings(['ZeroConf' => $actual]);
|
||||
@ -1502,11 +1497,8 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{internal: int, human: string} $expected
|
||||
*
|
||||
* @dataProvider valuesForMysqlMinVersionProvider
|
||||
*/
|
||||
/** @param array{internal: int, human: string} $expected */
|
||||
#[DataProvider('valuesForMysqlMinVersionProvider')]
|
||||
public function testMysqlMinVersion(mixed $actual, array $expected): void
|
||||
{
|
||||
$settings = new Settings(['MysqlMinVersion' => $actual]);
|
||||
|
||||
@ -10,8 +10,9 @@ use PhpMyAdmin\ConfigStorage\RelationParameters;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Dbal\ResultInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\ConfigStorage\RelationCleanup */
|
||||
#[CoversClass(RelationCleanup::class)]
|
||||
class RelationCleanupTest extends AbstractTestCase
|
||||
{
|
||||
public function testColumnWithoutRelations(): void
|
||||
|
||||
@ -4,32 +4,50 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests\ConfigStorage;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Features\BookmarkFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\BrowserTransformationFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\CentralColumnsFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\ColumnCommentsFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\ConfigurableMenusFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\DatabaseDesignerSettingsFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\DisplayFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\ExportTemplatesFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\FavoriteTablesFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\NavigationItemsHidingFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\PdfFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\RecentlyUsedTablesFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\RelationFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\SavedQueryByExampleSearchesFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\SqlHistoryFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\TrackingFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\UiPreferencesFeature;
|
||||
use PhpMyAdmin\ConfigStorage\Features\UserPreferencesFeature;
|
||||
use PhpMyAdmin\ConfigStorage\RelationParameters;
|
||||
use PhpMyAdmin\Identifiers\DatabaseName;
|
||||
use PhpMyAdmin\Version;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\ConfigStorage\RelationParameters
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\BookmarkFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\BrowserTransformationFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\CentralColumnsFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\ColumnCommentsFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\ConfigurableMenusFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\DatabaseDesignerSettingsFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\DisplayFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\ExportTemplatesFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\FavoriteTablesFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\NavigationItemsHidingFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\PdfFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\RecentlyUsedTablesFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\RelationFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\SavedQueryByExampleSearchesFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\SqlHistoryFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\TrackingFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\UiPreferencesFeature
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Features\UserPreferencesFeature
|
||||
*/
|
||||
#[CoversClass(RelationParameters::class)]
|
||||
#[CoversClass(BookmarkFeature::class)]
|
||||
#[CoversClass(BrowserTransformationFeature::class)]
|
||||
#[CoversClass(CentralColumnsFeature::class)]
|
||||
#[CoversClass(ColumnCommentsFeature::class)]
|
||||
#[CoversClass(ConfigurableMenusFeature::class)]
|
||||
#[CoversClass(DatabaseDesignerSettingsFeature::class)]
|
||||
#[CoversClass(DisplayFeature::class)]
|
||||
#[CoversClass(ExportTemplatesFeature::class)]
|
||||
#[CoversClass(FavoriteTablesFeature::class)]
|
||||
#[CoversClass(NavigationItemsHidingFeature::class)]
|
||||
#[CoversClass(PdfFeature::class)]
|
||||
#[CoversClass(RecentlyUsedTablesFeature::class)]
|
||||
#[CoversClass(RelationFeature::class)]
|
||||
#[CoversClass(SavedQueryByExampleSearchesFeature::class)]
|
||||
#[CoversClass(SqlHistoryFeature::class)]
|
||||
#[CoversClass(TrackingFeature::class)]
|
||||
#[CoversClass(UiPreferencesFeature::class)]
|
||||
#[CoversClass(UserPreferencesFeature::class)]
|
||||
class RelationParametersTest extends TestCase
|
||||
{
|
||||
public function testFeaturesWithTwoTables(): void
|
||||
@ -246,9 +264,8 @@ class RelationParametersTest extends TestCase
|
||||
/**
|
||||
* @param mixed[] $params
|
||||
* @param mixed[] $expected
|
||||
*
|
||||
* @dataProvider providerForTestToArray
|
||||
*/
|
||||
#[DataProvider('providerForTestToArray')]
|
||||
public function testToArray(array $params, array $expected): void
|
||||
{
|
||||
$this->assertSame($expected, RelationParameters::fromArray($params)->toArray());
|
||||
|
||||
@ -10,14 +10,15 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\RecentFavoriteTable;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use ReflectionClass;
|
||||
|
||||
use function implode;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\ConfigStorage\Relation
|
||||
* @group medium
|
||||
*/
|
||||
#[CoversClass(Relation::class)]
|
||||
#[Group('medium')]
|
||||
class RelationTest extends AbstractTestCase
|
||||
{
|
||||
/**
|
||||
@ -2162,9 +2163,8 @@ class RelationTest extends AbstractTestCase
|
||||
/**
|
||||
* @param array<string, bool|string> $params
|
||||
* @param string[] $queries
|
||||
*
|
||||
* @dataProvider providerForTestRenameTable
|
||||
*/
|
||||
#[DataProvider('providerForTestRenameTable')]
|
||||
public function testRenameTable(array $params, array $queries): void
|
||||
{
|
||||
$dummyDbi = $this->createDbiDummy();
|
||||
|
||||
@ -15,8 +15,10 @@ use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Url;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/** @covers \PhpMyAdmin\ConfigStorage\UserGroups */
|
||||
#[CoversClass(UserGroups::class)]
|
||||
class UserGroupsTest extends AbstractTestCase
|
||||
{
|
||||
private ConfigurableMenusFeature $configurableMenusFeature;
|
||||
@ -41,9 +43,8 @@ class UserGroupsTest extends AbstractTestCase
|
||||
|
||||
/**
|
||||
* Tests UserGroups::getHtmlForUserGroupsTable() function when there are no user groups
|
||||
*
|
||||
* @group medium
|
||||
*/
|
||||
#[Group('medium')]
|
||||
public function testGetHtmlForUserGroupsTableWithNoUserGroups(): void
|
||||
{
|
||||
$expectedQuery = 'SELECT * FROM `pmadb`.`usergroups` ORDER BY `usergroup` ASC';
|
||||
|
||||
@ -8,6 +8,10 @@ use PhpMyAdmin\Config;
|
||||
use PhpMyAdmin\Config\Settings;
|
||||
use PhpMyAdmin\Config\Settings\Server;
|
||||
use PhpMyAdmin\Dbal\Connection;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Depends;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
use function define;
|
||||
use function defined;
|
||||
@ -36,10 +40,8 @@ use const INFO_MODULES;
|
||||
use const PHP_OS;
|
||||
use const TEST_PATH;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Config
|
||||
* @psalm-import-type ConnectionType from Connection
|
||||
*/
|
||||
/** @psalm-import-type ConnectionType from Connection */
|
||||
#[CoversClass(Config::class)]
|
||||
class ConfigTest extends AbstractTestCase
|
||||
{
|
||||
protected Config $object;
|
||||
@ -126,9 +128,8 @@ PHP;
|
||||
|
||||
/**
|
||||
* Test for CheckSystem
|
||||
*
|
||||
* @group medium
|
||||
*/
|
||||
#[Group('medium')]
|
||||
public function testCheckSystem(): void
|
||||
{
|
||||
$this->object->checkSystem();
|
||||
@ -162,9 +163,8 @@ PHP;
|
||||
* @param string $os Expected parsed OS (or null if none)
|
||||
* @param string $browser Expected parsed browser (or null if none)
|
||||
* @param string $version Expected browser version (or null if none)
|
||||
*
|
||||
* @dataProvider userAgentProvider
|
||||
*/
|
||||
#[DataProvider('userAgentProvider')]
|
||||
public function testCheckClient(
|
||||
string $agent,
|
||||
string $os,
|
||||
@ -323,9 +323,8 @@ PHP;
|
||||
*
|
||||
* @param string $server Server identification
|
||||
* @param int $iis Whether server should be detected as IIS
|
||||
*
|
||||
* @dataProvider serverNames
|
||||
*/
|
||||
#[DataProvider('serverNames')]
|
||||
public function testCheckWebServer(string $server, int $iis): void
|
||||
{
|
||||
$_SERVER['SERVER_SOFTWARE'] = $server;
|
||||
@ -442,9 +441,8 @@ PHP;
|
||||
* @param string $pmaAbsoluteUri phpMyAdmin absolute URI
|
||||
* @param int $port server port
|
||||
* @param bool $expected expected result
|
||||
*
|
||||
* @dataProvider httpsParams
|
||||
*/
|
||||
#[DataProvider('httpsParams')]
|
||||
public function testIsHttps(
|
||||
string $scheme,
|
||||
string $https,
|
||||
@ -518,9 +516,8 @@ PHP;
|
||||
* @param string $request The request URL used for phpMyAdmin
|
||||
* @param string $absolute The absolute URL used for phpMyAdmin
|
||||
* @param string $expected Expected root path
|
||||
*
|
||||
* @dataProvider rootUris
|
||||
*/
|
||||
#[DataProvider('rootUris')]
|
||||
public function testGetRootPath(string $request, string $absolute, string $expected): void
|
||||
{
|
||||
$_SERVER['PHP_SELF'] = $request;
|
||||
@ -556,9 +553,8 @@ PHP;
|
||||
*
|
||||
* @param string $source File name of config to load
|
||||
* @param bool $result Expected result of loading
|
||||
*
|
||||
* @dataProvider configPaths
|
||||
*/
|
||||
#[DataProvider('configPaths')]
|
||||
public function testLoad(string $source, bool $result): void
|
||||
{
|
||||
if ($result) {
|
||||
@ -667,9 +663,8 @@ PHP;
|
||||
|
||||
/**
|
||||
* Test for getTempDir
|
||||
*
|
||||
* @group file-system
|
||||
*/
|
||||
#[Group('file-system')]
|
||||
public function testGetTempDir(): void
|
||||
{
|
||||
$dir = realpath(sys_get_temp_dir());
|
||||
@ -687,10 +682,9 @@ PHP;
|
||||
|
||||
/**
|
||||
* Test for getUploadTempDir
|
||||
*
|
||||
* @group file-system
|
||||
* @depends testGetTempDir
|
||||
*/
|
||||
#[Depends('testGetTempDir')]
|
||||
#[Group('file-system')]
|
||||
public function testGetUploadTempDir(): void
|
||||
{
|
||||
$dir = realpath(sys_get_temp_dir());
|
||||
@ -712,9 +706,8 @@ PHP;
|
||||
* @param mixed[] $settings settings array
|
||||
* @param string|mixed[] $request request
|
||||
* @param int $expected expected result
|
||||
*
|
||||
* @dataProvider selectServerProvider
|
||||
*/
|
||||
#[DataProvider('selectServerProvider')]
|
||||
public function testSelectServer(array $settings, string|array $request, int $expected): void
|
||||
{
|
||||
$config = new Config();
|
||||
@ -756,9 +749,8 @@ PHP;
|
||||
* @param mixed[] $serverCfg Server configuration
|
||||
* @param mixed[] $expected Expected result
|
||||
* @psalm-param ConnectionType $connectionType
|
||||
*
|
||||
* @dataProvider connectionParams
|
||||
*/
|
||||
#[DataProvider('connectionParams')]
|
||||
public function testGetConnectionParams(array $serverCfg, int $connectionType, array $expected): void
|
||||
{
|
||||
$result = Config::getConnectionParams(new Server($serverCfg), $connectionType);
|
||||
@ -894,11 +886,8 @@ PHP;
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-param ConnectionType $connectionType
|
||||
*
|
||||
* @dataProvider connectionParamsWhenConnectionIsUserOrAuxiliaryProvider
|
||||
*/
|
||||
/** @psalm-param ConnectionType $connectionType */
|
||||
#[DataProvider('connectionParamsWhenConnectionIsUserOrAuxiliaryProvider')]
|
||||
public function testGetConnectionParamsWhenConnectionIsUserOrAuxiliary(
|
||||
int $connectionType,
|
||||
string $host,
|
||||
|
||||
@ -7,9 +7,10 @@ namespace PhpMyAdmin\Tests;
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Console;
|
||||
use PhpMyAdmin\Template;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use ReflectionProperty;
|
||||
|
||||
/** @covers \PhpMyAdmin\Console */
|
||||
#[CoversClass(Console::class)]
|
||||
class ConsoleTest extends AbstractTestCase
|
||||
{
|
||||
public function testGetScripts(): void
|
||||
|
||||
@ -11,9 +11,10 @@ use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Throwable;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\AbstractController */
|
||||
#[CoversClass(AbstractController::class)]
|
||||
class AbstractControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\CheckRelationsController */
|
||||
#[CoversClass(CheckRelationsController::class)]
|
||||
class CheckRelationsControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -11,8 +11,9 @@ use PhpMyAdmin\ResponseRenderer;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Url;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\CollationConnectionController */
|
||||
#[CoversClass(CollationConnectionController::class)]
|
||||
class CollationConnectionControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testInvoke(): void
|
||||
|
||||
@ -11,9 +11,10 @@ use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use ReflectionClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Console\Bookmark\AddController */
|
||||
#[CoversClass(AddController::class)]
|
||||
class AddControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testWithInvalidParams(): void
|
||||
|
||||
@ -9,8 +9,9 @@ use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Console\Bookmark\RefreshController */
|
||||
#[CoversClass(RefreshController::class)]
|
||||
class RefreshControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -10,11 +10,10 @@ use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\Database\EventsController
|
||||
* @covers \PhpMyAdmin\Database\Events
|
||||
*/
|
||||
#[CoversClass(EventsController::class)]
|
||||
#[CoversClass(Events::class)]
|
||||
final class EventsControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testWithEvents(): void
|
||||
|
||||
@ -9,8 +9,9 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController */
|
||||
#[CoversClass(TablesController::class)]
|
||||
class TablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,10 +13,11 @@ use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Url;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Database\PrivilegesController */
|
||||
#[CoversClass(PrivilegesController::class)]
|
||||
class PrivilegesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -11,11 +11,10 @@ use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\Database\RoutinesController
|
||||
* @covers \PhpMyAdmin\Database\Routines
|
||||
*/
|
||||
#[CoversClass(RoutinesController::class)]
|
||||
#[CoversClass(Routines::class)]
|
||||
final class RoutinesControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testWithRoutines(): void
|
||||
|
||||
@ -12,11 +12,12 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use ReflectionClass;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Database\Structure\FavoriteTableController */
|
||||
#[CoversClass(FavoriteTableController::class)]
|
||||
class FavoriteTableControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -11,10 +11,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Database\Structure\RealRowCountController */
|
||||
#[CoversClass(RealRowCountController::class)]
|
||||
class RealRowCountControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -14,10 +14,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
use PhpMyAdmin\Tracking\TrackingChecker;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Database\StructureController */
|
||||
#[CoversClass(StructureController::class)]
|
||||
class StructureControllerTest extends AbstractTestCase
|
||||
{
|
||||
private ResponseStub $response;
|
||||
|
||||
@ -13,6 +13,7 @@ use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\FieldHelper;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function htmlspecialchars;
|
||||
|
||||
@ -23,7 +24,7 @@ use const MYSQLI_TYPE_DATETIME;
|
||||
use const MYSQLI_TYPE_DECIMAL;
|
||||
use const MYSQLI_TYPE_STRING;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Export\ExportController */
|
||||
#[CoversClass(ExportController::class)]
|
||||
class ExportControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -15,9 +15,10 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use ReflectionClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Export\Template\CreateController */
|
||||
#[CoversClass(CreateController::class)]
|
||||
class CreateControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Export\Template\DeleteController */
|
||||
#[CoversClass(DeleteController::class)]
|
||||
class DeleteControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -14,9 +14,10 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use ReflectionClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Export\Template\LoadController */
|
||||
#[CoversClass(LoadController::class)]
|
||||
class LoadControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Export\Template\UpdateController */
|
||||
#[CoversClass(UpdateController::class)]
|
||||
class UpdateControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -8,8 +8,11 @@ use PhpMyAdmin\Controllers\GisDataEditorController;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\GisDataEditorController */
|
||||
#[CoversClass(GisDataEditorController::class)]
|
||||
class GisDataEditorControllerTest extends AbstractTestCase
|
||||
{
|
||||
private GisDataEditorController|null $controller = null;
|
||||
@ -32,10 +35,9 @@ class GisDataEditorControllerTest extends AbstractTestCase
|
||||
/**
|
||||
* @param mixed[] $gisData
|
||||
* @param mixed[] $expected
|
||||
*
|
||||
* @group gis
|
||||
* @dataProvider providerForTestValidateGisData
|
||||
*/
|
||||
#[DataProvider('providerForTestValidateGisData')]
|
||||
#[Group('gis')]
|
||||
public function testValidateGisData(array $gisData, string $type, string|null $value, array $expected): void
|
||||
{
|
||||
/** @var mixed[] $gisData */
|
||||
|
||||
@ -9,8 +9,9 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Import\ImportController */
|
||||
#[CoversClass(ImportController::class)]
|
||||
class ImportControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -5,16 +5,18 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers;
|
||||
|
||||
use PhpMyAdmin\Controllers\JavaScriptMessagesController;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
use function json_decode;
|
||||
use function strlen;
|
||||
use function substr;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\JavaScriptMessagesController */
|
||||
#[CoversClass(JavaScriptMessagesController::class)]
|
||||
class JavaScriptMessagesControllerTest extends TestCase
|
||||
{
|
||||
/** @runInSeparateProcess */
|
||||
#[RunInSeparateProcess]
|
||||
public function testIndex(): void
|
||||
{
|
||||
(new JavaScriptMessagesController())();
|
||||
|
||||
@ -9,13 +9,13 @@ use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\LintController
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
#[CoversClass(LintController::class)]
|
||||
#[RunTestsInSeparateProcesses]
|
||||
class LintControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
|
||||
@ -9,8 +9,9 @@ use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Plugins\AuthenticationPlugin;
|
||||
use PhpMyAdmin\Plugins\AuthenticationPluginFactory;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\LogoutController */
|
||||
#[CoversClass(LogoutController::class)]
|
||||
class LogoutControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testValidLogout(): void
|
||||
|
||||
@ -9,10 +9,11 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\NavigationController */
|
||||
#[CoversClass(NavigationController::class)]
|
||||
class NavigationControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\AddNewPrimaryController */
|
||||
#[CoversClass(AddNewPrimaryController::class)]
|
||||
class AddNewPrimaryControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\CreateNewColumnController */
|
||||
#[CoversClass(CreateNewColumnController::class)]
|
||||
class CreateNewColumnControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,17 +12,16 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\FirstNormalForm\FirstStepController */
|
||||
#[CoversClass(FirstStepController::class)]
|
||||
class FirstStepControllerTest extends AbstractTestCase
|
||||
{
|
||||
/**
|
||||
* @psalm-param '1nf'|'2nf'|'3nf' $expectedNormalizeTo
|
||||
*
|
||||
* @dataProvider providerForTestDefault
|
||||
*/
|
||||
/** @psalm-param '1nf'|'2nf'|'3nf' $expectedNormalizeTo */
|
||||
#[DataProvider('providerForTestDefault')]
|
||||
public function testDefault(string|null $normalizeTo, string $expectedNormalizeTo): void
|
||||
{
|
||||
$GLOBALS['db'] = 'test_db';
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\FirstNormalForm\FourthStepController */
|
||||
#[CoversClass(FourthStepController::class)]
|
||||
class FourthStepControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\FirstNormalForm\SecondStepController */
|
||||
#[CoversClass(SecondStepController::class)]
|
||||
class SecondStepControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\FirstNormalForm\ThirdStepController */
|
||||
#[CoversClass(ThirdStepController::class)]
|
||||
class ThirdStepControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\GetColumnsController */
|
||||
#[CoversClass(GetColumnsController::class)]
|
||||
class GetColumnsControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -11,10 +11,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\MainController */
|
||||
#[CoversClass(MainController::class)]
|
||||
class MainControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\MoveRepeatingGroup */
|
||||
#[CoversClass(MoveRepeatingGroup::class)]
|
||||
class MoveRepeatingGroupTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\PartialDependenciesController */
|
||||
#[CoversClass(PartialDependenciesController::class)]
|
||||
class PartialDependenciesControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,10 +12,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\SecondNormalForm\CreateNewTablesController */
|
||||
#[CoversClass(CreateNewTablesController::class)]
|
||||
class CreateNewTablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\SecondNormalForm\FirstStepController */
|
||||
#[CoversClass(FirstStepController::class)]
|
||||
class FirstStepControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,10 +12,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\SecondNormalForm\NewTablesController */
|
||||
#[CoversClass(NewTablesController::class)]
|
||||
class NewTablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,10 +12,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\ThirdNormalForm\CreateNewTablesController */
|
||||
#[CoversClass(CreateNewTablesController::class)]
|
||||
class CreateNewTablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\ThirdNormalForm\FirstStepController */
|
||||
#[CoversClass(FirstStepController::class)]
|
||||
class FirstStepControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -12,10 +12,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Normalization\ThirdNormalForm\NewTablesController */
|
||||
#[CoversClass(NewTablesController::class)]
|
||||
class NewTablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testDefault(): void
|
||||
|
||||
@ -9,11 +9,13 @@ use PhpMyAdmin\Export;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\SchemaExportController */
|
||||
#[CoversClass(SchemaExportController::class)]
|
||||
class SchemaExportControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @runInSeparateProcess */
|
||||
#[RunInSeparateProcess]
|
||||
public function testExport(): void
|
||||
{
|
||||
$GLOBALS['dbi'] = $this->createDatabaseInterface();
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Url;
|
||||
use PhpMyAdmin\Utils\SessionCache;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\BinlogController */
|
||||
#[CoversClass(BinlogController::class)]
|
||||
class BinlogControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -11,8 +11,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\CollationsController */
|
||||
#[CoversClass(CollationsController::class)]
|
||||
class CollationsControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -11,11 +11,12 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
use function sprintf;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Databases\CreateController */
|
||||
#[CoversClass(CreateController::class)]
|
||||
final class CreateControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,10 +13,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Databases\DestroyController */
|
||||
#[CoversClass(DestroyController::class)]
|
||||
class DestroyControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
|
||||
@ -11,10 +11,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\DatabasesController */
|
||||
#[CoversClass(DatabasesController::class)]
|
||||
class DatabasesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -11,8 +11,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\EnginesController */
|
||||
#[CoversClass(EnginesController::class)]
|
||||
class EnginesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\PluginsController */
|
||||
#[CoversClass(PluginsController::class)]
|
||||
class PluginsControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,9 +13,10 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\MockObject\Stub;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Privileges\AccountLockController */
|
||||
#[CoversClass(AccountLockController::class)]
|
||||
class AccountLockControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface&Stub */
|
||||
|
||||
@ -13,9 +13,10 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\MockObject\Stub;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Privileges\AccountUnlockController */
|
||||
#[CoversClass(AccountUnlockController::class)]
|
||||
class AccountUnlockControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface&Stub */
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\PrivilegesController */
|
||||
#[CoversClass(PrivilegesController::class)]
|
||||
class PrivilegesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,11 +13,12 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
use function htmlspecialchars;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\ShowEngineController */
|
||||
#[CoversClass(ShowEngineController::class)]
|
||||
class ShowEngineControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -11,9 +11,10 @@ use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\AdvisorController */
|
||||
#[CoversClass(AdvisorController::class)]
|
||||
class AdvisorControllerTest extends AbstractTestCase
|
||||
{
|
||||
private ResponseRenderer $response;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\GeneralLogController */
|
||||
#[CoversClass(GeneralLogController::class)]
|
||||
class GeneralLogControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\LogVarsController */
|
||||
#[CoversClass(LogVarsController::class)]
|
||||
class LogVarsControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Utils\SessionCache;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\QueryAnalyzerController */
|
||||
#[CoversClass(QueryAnalyzerController::class)]
|
||||
class QueryAnalyzerControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\SlowLogController */
|
||||
#[CoversClass(SlowLogController::class)]
|
||||
class SlowLogControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -12,10 +12,11 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\MonitorController */
|
||||
#[CoversClass(MonitorController::class)]
|
||||
class MonitorControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -12,11 +12,12 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Url;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
use function htmlspecialchars;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\Processes\RefreshController */
|
||||
#[CoversClass(RefreshController::class)]
|
||||
class RefreshControllerTest extends AbstractTestCase
|
||||
{
|
||||
private Data $data;
|
||||
|
||||
@ -13,8 +13,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\ProcessesController */
|
||||
#[CoversClass(ProcessesController::class)]
|
||||
class ProcessesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -13,12 +13,13 @@ use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Util;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
use function __;
|
||||
use function array_sum;
|
||||
use function htmlspecialchars;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\QueriesController */
|
||||
#[CoversClass(QueriesController::class)]
|
||||
class QueriesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -14,8 +14,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\StatusController */
|
||||
#[CoversClass(StatusController::class)]
|
||||
class StatusControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -12,8 +12,9 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\Status\VariablesController */
|
||||
#[CoversClass(VariablesController::class)]
|
||||
class VariablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected DatabaseInterface $dbi;
|
||||
|
||||
@ -16,6 +16,7 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use ReflectionProperty;
|
||||
|
||||
@ -23,7 +24,7 @@ use function __;
|
||||
use function htmlspecialchars;
|
||||
use function str_replace;
|
||||
|
||||
/** @covers \PhpMyAdmin\Controllers\Server\VariablesController */
|
||||
#[CoversClass(VariablesController::class)]
|
||||
class VariablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user