Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2022-09-04 01:23:13 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2022-09-04 01:23:13 +0300
commit2b0a3da81033822643b5723000faf6f96a360b6e (patch)
treea7c53e8c6fa556eb497208279e93a0d41e868109 /test
parent0319d34ee60b2b30a0c1096743b10fccadce7340 (diff)
Fix some errors found by PHPStan in ZipExtensionTest class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'test')
-rw-r--r--test/classes/ZipExtensionTest.php29
1 files changed, 18 insertions, 11 deletions
diff --git a/test/classes/ZipExtensionTest.php b/test/classes/ZipExtensionTest.php
index 1468c1db62..cbb1244006 100644
--- a/test/classes/ZipExtensionTest.php
+++ b/test/classes/ZipExtensionTest.php
@@ -29,13 +29,14 @@ class ZipExtensionTest extends AbstractTestCase
/**
* Test for getContents
*
- * @param string $file path to zip file
- * @param string|null $specific_entry regular expression to match a file
- * @param mixed $output expected output
+ * @param string $file path to zip file
+ * @param string|null $specific_entry regular expression to match a file
+ * @param array<string, string> $output expected output
+ * @psalm-param array{error: string, data: string} $output
*
* @dataProvider provideTestGetContents
*/
- public function testGetContents(string $file, ?string $specific_entry, $output): void
+ public function testGetContents(string $file, ?string $specific_entry, array $output): void
{
$this->assertEquals(
$this->zipExtension->getContents($file, $specific_entry),
@@ -44,9 +45,8 @@ class ZipExtensionTest extends AbstractTestCase
}
/**
- * Provider for testGetZipContents
- *
- * @return array
+ * @return array<string, array<int, array<string, string>|string|null>>
+ * @psalm-return array<string, array{string, string|null, array{error: string, data: string}}>
*/
public function provideTestGetContents(): array
{
@@ -81,9 +81,10 @@ class ZipExtensionTest extends AbstractTestCase
/**
* Test for findFile
*
- * @param string $file path to zip file
- * @param string $file_regexp regular expression for the file name to match
- * @param mixed $output expected output
+ * @param string $file path to zip file
+ * @param string $file_regexp regular expression for the file name to match
+ * @param string|bool $output expected output
+ * @psalm-param string|false $output
*
* @dataProvider provideTestFindFile
*/
@@ -98,7 +99,8 @@ class ZipExtensionTest extends AbstractTestCase
/**
* Provider for testFindFileFromZipArchive
*
- * @return array Test data
+ * @return array<int, array<int, string|bool>>
+ * @psalm-return array<int, array{string, string, string|false}>
*/
public function provideTestFindFile(): array
{
@@ -108,6 +110,11 @@ class ZipExtensionTest extends AbstractTestCase
'/test/',
'test.file',
],
+ [
+ './test/test_data/test.zip',
+ '/invalid/',
+ false,
+ ],
];
}