From cbd23e5c0f1e732320028724cc2341a948786f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 25 Mar 2022 16:27:40 -0300 Subject: [PATCH 1/2] Skip GitTest when remote commit info is unavailable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- test/classes/GitTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/classes/GitTest.php b/test/classes/GitTest.php index 775fef3dfa..4206778fb3 100644 --- a/test/classes/GitTest.php +++ b/test/classes/GitTest.php @@ -233,6 +233,13 @@ class GitTest extends AbstractTestCase $commit = $this->object->checkGitRevision(); + if ( + $commit === null + && ! isset($_SESSION['PMA_VERSION_REMOTECOMMIT_17bf8b7309919f8ac593d7c563b31472780ee83b']) + ) { + $this->markTestSkipped('Unable to get remote commit information.'); + } + $this->assertIsArray($commit); $this->assertArrayHasKey('hash', $commit); $this->assertEquals('17bf8b7309919f8ac593d7c563b31472780ee83b', $commit['hash']); @@ -359,6 +366,13 @@ class GitTest extends AbstractTestCase $commit = $this->object->checkGitRevision(); + if ( + $commit === null + && ! isset($_SESSION['PMA_VERSION_REMOTECOMMIT_17bf8b7309919f8ac593d7c563b31472780ee83b']) + ) { + $this->markTestSkipped('Unable to get remote commit information.'); + } + $this->assertIsArray($commit); $this->assertArrayHasKey('hash', $commit); $this->assertEquals('17bf8b7309919f8ac593d7c563b31472780ee83b', $commit['hash']); From 32b8fe1c4b4df8b7cc368138f89024744100292e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 25 Mar 2022 16:42:27 -0300 Subject: [PATCH 2/2] Add covers annotation to OpenDocumentTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- phpstan-baseline.neon | 5 ----- test/classes/OpenDocumentTest.php | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2b2932b66a..05b8dce1f3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -9010,11 +9010,6 @@ parameters: count: 1 path: libraries/classes/Utils/HttpRequest.php - - - message: "#^Parameter \\#2 \\$httpStatus of method PhpMyAdmin\\\\Utils\\\\HttpRequest\\:\\:response\\(\\) expects int, mixed given\\.$#" - count: 1 - path: libraries/classes/Utils/HttpRequest.php - - message: "#^Variable \\$http_response_header in isset\\(\\) always exists and is not nullable\\.$#" count: 1 diff --git a/test/classes/OpenDocumentTest.php b/test/classes/OpenDocumentTest.php index 7ec98d73b9..e87af1503c 100644 --- a/test/classes/OpenDocumentTest.php +++ b/test/classes/OpenDocumentTest.php @@ -14,6 +14,7 @@ use function tempnam; use function unlink; /** + * @covers \PhpMyAdmin\OpenDocument * @requires extension zip */ class OpenDocumentTest extends AbstractTestCase