diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a67dae2321..e4ef19a157 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,6 +2,7 @@ diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index 0d97b5b6ce..51b82cd830 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -7,6 +7,9 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Advisor; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +/** + * @covers \PhpMyAdmin\Advisor + */ class AdvisorTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/BookmarkTest.php b/test/classes/BookmarkTest.php index d5ba3b1c18..ee9dee94fd 100644 --- a/test/classes/BookmarkTest.php +++ b/test/classes/BookmarkTest.php @@ -6,6 +6,9 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Bookmark; +/** + * @covers \PhpMyAdmin\Bookmark + */ class BookmarkTest extends AbstractTestCase { /** diff --git a/test/classes/BrowseForeignersTest.php b/test/classes/BrowseForeignersTest.php index d951741254..17ba009dec 100644 --- a/test/classes/BrowseForeignersTest.php +++ b/test/classes/BrowseForeignersTest.php @@ -7,6 +7,9 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\BrowseForeigners; use PhpMyAdmin\Template; +/** + * @covers \PhpMyAdmin\BrowseForeigners + */ class BrowseForeignersTest extends AbstractTestCase { /** @var BrowseForeigners */ diff --git a/test/classes/Charsets/CharsetTest.php b/test/classes/Charsets/CharsetTest.php index 28eac0c58f..93782260ae 100644 --- a/test/classes/Charsets/CharsetTest.php +++ b/test/classes/Charsets/CharsetTest.php @@ -7,6 +7,9 @@ namespace PhpMyAdmin\Tests\Charsets; use PhpMyAdmin\Charsets\Charset; use PhpMyAdmin\Tests\AbstractTestCase; +/** + * @covers \PhpMyAdmin\Charsets\Charset + */ class CharsetTest extends AbstractTestCase { public function testFromServer(): void diff --git a/test/classes/Charsets/CollationTest.php b/test/classes/Charsets/CollationTest.php index a88fba230f..e161410965 100644 --- a/test/classes/Charsets/CollationTest.php +++ b/test/classes/Charsets/CollationTest.php @@ -7,6 +7,9 @@ namespace PhpMyAdmin\Tests\Charsets; use PhpMyAdmin\Charsets\Collation; use PhpMyAdmin\Tests\AbstractTestCase; +/** + * @covers \PhpMyAdmin\Charsets\Collation + */ class CollationTest extends AbstractTestCase { public function testFromServer(): void diff --git a/test/classes/CharsetsTest.php b/test/classes/CharsetsTest.php index 57596dd7b5..f9b1bc61b1 100644 --- a/test/classes/CharsetsTest.php +++ b/test/classes/CharsetsTest.php @@ -1,7 +1,4 @@ assertEquals( diff --git a/test/classes/Html/MySQLDocumentationTest.php b/test/classes/Html/MySQLDocumentationTest.php index c4495bf666..9057667c5c 100644 --- a/test/classes/Html/MySQLDocumentationTest.php +++ b/test/classes/Html/MySQLDocumentationTest.php @@ -7,11 +7,11 @@ namespace PhpMyAdmin\Tests\Html; use PhpMyAdmin\Html\MySQLDocumentation; use PhpMyAdmin\Tests\AbstractTestCase; +/** + * @covers \PhpMyAdmin\Html\MySQLDocumentation + */ class MySQLDocumentationTest extends AbstractTestCase { - /** - * @covers \PhpMyAdmin\Html\MySQLDocumentation::showDocumentation - */ public function testShowDocumentation(): void { $GLOBALS['server'] = '99'; diff --git a/test/classes/Html/SecurityTest.php b/test/classes/Html/SecurityTest.php index 8ae19f66ee..ef7d56ff56 100644 --- a/test/classes/Html/SecurityTest.php +++ b/test/classes/Html/SecurityTest.php @@ -8,6 +8,9 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Url; +/** + * @coversNothing + */ class SecurityTest extends AbstractTestCase { /** @var Template */ diff --git a/test/classes/ImportTest.php b/test/classes/ImportTest.php index adcf0ef939..00d765ba16 100644 --- a/test/classes/ImportTest.php +++ b/test/classes/ImportTest.php @@ -14,7 +14,7 @@ use function time; use const PHP_INT_MAX; /** - * Tests for import functions + * @covers \PhpMyAdmin\Import */ class ImportTest extends AbstractTestCase { diff --git a/test/classes/IndexTest.php b/test/classes/IndexTest.php index 04546ceb9f..4109fcda72 100644 --- a/test/classes/IndexTest.php +++ b/test/classes/IndexTest.php @@ -6,6 +6,9 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Index; +/** + * @covers \PhpMyAdmin\Index + */ class IndexTest extends AbstractTestCase { /** @var array */ diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index d45d2d77b4..96aefd9753 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -26,6 +26,7 @@ use const MYSQLI_TYPE_TIMESTAMP; use const MYSQLI_TYPE_TINY; /** + * @covers \PhpMyAdmin\InsertEdit * @group medium */ class InsertEditTest extends AbstractTestCase diff --git a/test/classes/IpAllowDenyTest.php b/test/classes/IpAllowDenyTest.php index b10de4d536..7c16ee6ecf 100644 --- a/test/classes/IpAllowDenyTest.php +++ b/test/classes/IpAllowDenyTest.php @@ -8,9 +8,7 @@ use PhpMyAdmin\Core; use PhpMyAdmin\IpAllowDeny; /** - * PhpMyAdmin\Tests\IpAllowDenyTest class - * - * this class is for testing PhpMyAdmin\IpAllowDeny + * @covers \PhpMyAdmin\IpAllowDeny */ class IpAllowDenyTest extends AbstractTestCase { diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index 93aa7ef00c..96bfefedbc 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -11,6 +11,11 @@ use function count; use function is_readable; use function strtolower; +/** + * @uses \PhpMyAdmin\LanguageManager + * + * @covers \PhpMyAdmin\Language + */ class LanguageTest extends AbstractTestCase { /** @var LanguageManager */ diff --git a/test/classes/LinterTest.php b/test/classes/LinterTest.php index f41e38b4d3..e00183a51f 100644 --- a/test/classes/LinterTest.php +++ b/test/classes/LinterTest.php @@ -1,7 +1,4 @@ assertEquals(16, strlen(Util::generateRandom(16))); } - /** - * Test clearing user cache - * - * @covers \PhpMyAdmin\Util::clearUserCache - */ public function testClearUserCache(): void { $GLOBALS['server'] = 'server'; @@ -342,11 +340,6 @@ class UtilTest extends AbstractTestCase ); } - /** - * Test for Util::checkParameters - * - * @covers \PhpMyAdmin\Util::checkParameters - */ public function testCheckParameterMissing(): void { parent::setGlobalConfig(); @@ -369,11 +362,6 @@ class UtilTest extends AbstractTestCase ); } - /** - * Test for Util::checkParameters - * - * @covers \PhpMyAdmin\Util::checkParameters - */ public function testCheckParameter(): void { parent::setGlobalConfig(); @@ -402,7 +390,6 @@ class UtilTest extends AbstractTestCase * @param string|null $bit Value * @param string $val Expected value * - * @covers \PhpMyAdmin\Util::convertBitDefaultValue * @dataProvider providerConvertBitDefaultValue */ public function testConvertBitDefaultValue(?string $bit, string $val): void @@ -505,7 +492,6 @@ class UtilTest extends AbstractTestCase * @param string $a Expected value * @param string $b String to escape * - * @covers \PhpMyAdmin\Util::escapeMysqlWildcards * @dataProvider providerUnEscapeMysqlWildcards */ public function testEscapeMysqlWildcards(string $a, string $b): void @@ -522,7 +508,6 @@ class UtilTest extends AbstractTestCase * @param string $a String to unescape * @param string $b Expected value * - * @covers \PhpMyAdmin\Util::unescapeMysqlWildcards * @dataProvider providerUnEscapeMysqlWildcards */ public function testUnescapeMysqlWildcards(string $a, string $b): void @@ -539,7 +524,6 @@ class UtilTest extends AbstractTestCase * @param string $in string to evaluate * @param string $out expected output * - * @covers \PhpMyAdmin\Util::expandUserString * @dataProvider providerExpandUserString */ public function testExpandUserString(string $in, string $out): void @@ -610,7 +594,6 @@ class UtilTest extends AbstractTestCase * @param string $in Column specification * @param array $out Expected value * - * @covers \PhpMyAdmin\Util::extractColumnSpec * @dataProvider providerExtractColumnSpec */ public function testExtractColumnSpec(string $in, array $out): void @@ -758,7 +741,6 @@ class UtilTest extends AbstractTestCase * @param int|string $size Size * @param int|float $expected Expected value (float on some cpu architectures) * - * @covers \PhpMyAdmin\Util::extractValueFromFormattedSize * @dataProvider providerExtractValueFromFormattedSize */ public function testExtractValueFromFormattedSize($size, $expected): void @@ -804,7 +786,6 @@ class UtilTest extends AbstractTestCase * @param int $c Number of decimals to retain * @param array $e Expected value * - * @covers \PhpMyAdmin\Util::formatByteDown * @dataProvider providerFormatByteDown */ public function testFormatByteDown($a, int $b, int $c, array $e): void @@ -972,7 +953,6 @@ class UtilTest extends AbstractTestCase * @param int $c Number of decimals to retain * @param string $d Expected value * - * @covers \PhpMyAdmin\Util::formatNumber * @dataProvider providerFormatNumber */ public function testFormatNumber($a, int $b, int $c, string $d): void @@ -1144,7 +1124,6 @@ class UtilTest extends AbstractTestCase * @param string $unit Unit * @param string $res Result * - * @covers \PhpMyAdmin\Util::getFormattedMaximumUploadSize * @dataProvider providerGetFormattedMaximumUploadSize */ public function testGetFormattedMaximumUploadSize($size, string $unit, string $res): void @@ -1207,7 +1186,6 @@ class UtilTest extends AbstractTestCase * @param string $target Target * @param string $result Expected value * - * @covers \PhpMyAdmin\Util::getTitleForTarget * @dataProvider providerGetTitleForTarget */ public function testGetTitleForTarget(string $target, string $result): void @@ -1262,7 +1240,6 @@ class UtilTest extends AbstractTestCase * @param string $tz Timezone to set * @param string $locale Locale to set * - * @covers \PhpMyAdmin\Util::localisedDate * @dataProvider providerLocalisedDate */ public function testLocalisedDate(int $a, string $b, string $e, string $tz, string $locale): void @@ -1399,7 +1376,6 @@ class UtilTest extends AbstractTestCase * @param int $a Timespan in seconds * @param string $e Expected output * - * @covers \PhpMyAdmin\Util::timespanFormat * @dataProvider providerTimespanFormat */ public function testTimespanFormat(int $a, string $e): void @@ -1442,7 +1418,6 @@ class UtilTest extends AbstractTestCase * @param int $b Length * @param string $e Expected output * - * @covers \PhpMyAdmin\Util::printableBitValue * @dataProvider providerPrintableBitValue */ public function testPrintableBitValue(int $a, int $b, string $e): void @@ -1480,7 +1455,6 @@ class UtilTest extends AbstractTestCase * @param string $param String * @param string $expected Expected output * - * @covers \PhpMyAdmin\Util::unQuote * @dataProvider providerUnQuote */ public function testUnQuote(string $param, string $expected): void @@ -1524,7 +1498,6 @@ class UtilTest extends AbstractTestCase * @param string $param String * @param string $expected Expected output * - * @covers \PhpMyAdmin\Util::unQuote * @dataProvider providerUnQuoteSelectedChar */ public function testUnQuoteSelectedChar(string $param, string $expected): void @@ -1568,7 +1541,6 @@ class UtilTest extends AbstractTestCase * @param string|array $a String * @param string|array $b Expected output * - * @covers \PhpMyAdmin\Util::backquote * @dataProvider providerBackquote */ public function testBackquote($a, $b): void @@ -1624,7 +1596,6 @@ class UtilTest extends AbstractTestCase * @param string|array $expectedNoneOutput Expected none output * @param string|array $expectedMssqlOutput Expected MSSQL output * - * @covers \PhpMyAdmin\Util::backquoteCompat * @dataProvider providerBackquoteCompat */ public function testBackquoteCompat($entry, $expectedNoneOutput, $expectedMssqlOutput): void @@ -1691,8 +1662,6 @@ class UtilTest extends AbstractTestCase /** * backquoteCompat test with forbidden words - * - * @covers \PhpMyAdmin\Util::backquote */ public function testBackquoteForbidenWords(): void { @@ -1717,7 +1686,6 @@ class UtilTest extends AbstractTestCase * @param string $a String * @param string $e Expected output * - * @covers \PhpMyAdmin\Util::userDir * @dataProvider providerUserDir */ public function testUserDir(string $a, string $e): void @@ -1752,7 +1720,6 @@ class UtilTest extends AbstractTestCase * @param string $a String * @param string $e Expected output * - * @covers \PhpMyAdmin\Util::duplicateFirstNewline * @dataProvider providerDuplicateFirstNewline */ public function testDuplicateFirstNewline(string $a, string $e): void @@ -1790,11 +1757,6 @@ class UtilTest extends AbstractTestCase ]; } - /** - * Test for Util::unsupportedDatatypes - * - * @covers \PhpMyAdmin\Util::unsupportedDatatypes - */ public function testUnsupportedDatatypes(): void { $no_support_types = []; @@ -1804,11 +1766,6 @@ class UtilTest extends AbstractTestCase ); } - /** - * Test for Util::getPageFromPosition - * - * @covers \PhpMyAdmin\Util::getPageFromPosition - */ public function testGetPageFromPosition(): void { $this->assertEquals(Util::getPageFromPosition(0, 1), 1); diff --git a/test/classes/Utils/ForeignKeyTest.php b/test/classes/Utils/ForeignKeyTest.php index db199f4636..e792de8985 100644 --- a/test/classes/Utils/ForeignKeyTest.php +++ b/test/classes/Utils/ForeignKeyTest.php @@ -8,6 +8,9 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Utils\ForeignKey; +/** + * @covers \PhpMyAdmin\Utils\ForeignKey + */ class ForeignKeyTest extends AbstractTestCase { /** diff --git a/test/classes/Utils/FormatConverterTest.php b/test/classes/Utils/FormatConverterTest.php index 2f62b9e4b1..4d43fbc4a5 100644 --- a/test/classes/Utils/FormatConverterTest.php +++ b/test/classes/Utils/FormatConverterTest.php @@ -9,6 +9,9 @@ use PhpMyAdmin\Utils\FormatConverter; use function hex2bin; +/** + * @covers \PhpMyAdmin\Utils\FormatConverter + */ class FormatConverterTest extends AbstractTestCase { /** diff --git a/test/classes/Utils/GisTest.php b/test/classes/Utils/GisTest.php index a208e30f3d..022a84b110 100644 --- a/test/classes/Utils/GisTest.php +++ b/test/classes/Utils/GisTest.php @@ -10,6 +10,9 @@ use PhpMyAdmin\Utils\Gis; use function hex2bin; +/** + * @covers \PhpMyAdmin\Utils\Gis + */ class GisTest extends AbstractTestCase { /** diff --git a/test/classes/Utils/HttpRequestTest.php b/test/classes/Utils/HttpRequestTest.php index 18f60210b5..4aa8faea34 100644 --- a/test/classes/Utils/HttpRequestTest.php +++ b/test/classes/Utils/HttpRequestTest.php @@ -15,6 +15,9 @@ use function stripos; use const CURLOPT_CAINFO; use const CURLOPT_CAPATH; +/** + * @covers \PhpMyAdmin\Utils\HttpRequest + */ class HttpRequestTest extends AbstractTestCase { /** @var HttpRequest */ diff --git a/test/classes/Utils/SessionCacheTest.php b/test/classes/Utils/SessionCacheTest.php index f994db0dfa..efede762b7 100644 --- a/test/classes/Utils/SessionCacheTest.php +++ b/test/classes/Utils/SessionCacheTest.php @@ -7,6 +7,9 @@ namespace PhpMyAdmin\Tests\Utils; use PhpMyAdmin\Utils\SessionCache; use PHPUnit\Framework\TestCase; +/** + * @covers \PhpMyAdmin\Utils\SessionCache + */ class SessionCacheTest extends TestCase { public function testGet(): void diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index 2983289f13..c2569565c0 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -9,6 +9,9 @@ use stdClass; use function count; +/** + * @covers \PhpMyAdmin\VersionInformation + */ class VersionInformationTest extends AbstractTestCase { /** @var stdClass[] */ diff --git a/test/classes/VersionTest.php b/test/classes/VersionTest.php index 45fe54ea39..85e904af41 100644 --- a/test/classes/VersionTest.php +++ b/test/classes/VersionTest.php @@ -8,6 +8,9 @@ use PhpMyAdmin\Version; use function defined; +/** + * @covers \PhpMyAdmin\Version + */ class VersionTest extends AbstractTestCase { /** diff --git a/test/classes/ZipExtensionTest.php b/test/classes/ZipExtensionTest.php index a168033044..c5726b6cc1 100644 --- a/test/classes/ZipExtensionTest.php +++ b/test/classes/ZipExtensionTest.php @@ -1,7 +1,4 @@