diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 32d307c24a..4359328898 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -14972,6 +14972,11 @@ + + + + + diff --git a/tests/unit/InsertEditTest.php b/tests/unit/InsertEditTest.php index ad149e7214..45ec22edf4 100644 --- a/tests/unit/InsertEditTest.php +++ b/tests/unit/InsertEditTest.php @@ -42,6 +42,8 @@ use const MYSQLI_TYPE_TIMESTAMP; use const MYSQLI_TYPE_TINY; #[CoversClass(InsertEdit::class)] +#[CoversClass(EditField::class)] +#[CoversClass(InsertEditColumn::class)] #[Group('medium')] class InsertEditTest extends AbstractTestCase { diff --git a/tests/unit/SessionTest.php b/tests/unit/SessionTest.php new file mode 100644 index 0000000000..27115aa131 --- /dev/null +++ b/tests/unit/SessionTest.php @@ -0,0 +1,32 @@ +setValue(null, null); + $GLOBALS['lang'] = 'en'; + $config = Config::getInstance(); + $config->settings['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin'; + + $response = UrlRedirector::redirect('https://user:pass@example.com/'); + self::assertSame('/phpmyadmin/', $response->getHeaderLine('Location')); + self::assertSame(StatusCodeInterface::STATUS_FOUND, $response->getStatusCode()); + } + + public function testRedirectWithAllowedUrl(): void + { + (new ReflectionProperty(ResponseRenderer::class, 'instance'))->setValue(null, null); + $GLOBALS['lang'] = 'en'; + $_SERVER['SERVER_NAME'] = 'localhost'; + + UrlRedirector::redirect('https://phpmyadmin.net/'); + $output = self::getActualOutputForAssertion(); + $expected = <<<'HTML' + +Taking you to the target site. +HTML; + + self::assertSame($expected, $output); + } +} diff --git a/tests/unit/VersionInformationTest.php b/tests/unit/VersionInformationTest.php index a80db08f68..3a5cfe2d2c 100644 --- a/tests/unit/VersionInformationTest.php +++ b/tests/unit/VersionInformationTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; #[CoversClass(VersionInformation::class)] +#[CoversClass(Release::class)] class VersionInformationTest extends AbstractTestCase { /** @var Release[] */