From fa0f25735b7c4d7145f486306e22bd165f9b87b5 Mon Sep 17 00:00:00 2001 From: Jisse Reitsma Date: Tue, 8 Oct 2024 14:39:55 +0200 Subject: [PATCH] PHPStan fixes --- Test/Integration/GraphQlTestCase.php | 1 + Test/Integration/Traits/AssertModuleIsRegisteredForReal.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Test/Integration/GraphQlTestCase.php b/Test/Integration/GraphQlTestCase.php index 0d3f3e4..b7186de 100644 --- a/Test/Integration/GraphQlTestCase.php +++ b/Test/Integration/GraphQlTestCase.php @@ -17,6 +17,7 @@ class GraphQlTestCase extends AbstractTestCase */ protected function getGraphQlQueryData(string $query): array { + // @phpstan-ignore-next-line $graphQlRequest = $this->objectManager->get(GraphQlRequest::class); $response = $graphQlRequest->send($query); return json_decode($response->getContent(), true); diff --git a/Test/Integration/Traits/AssertModuleIsRegisteredForReal.php b/Test/Integration/Traits/AssertModuleIsRegisteredForReal.php index 31f87c4..941592c 100644 --- a/Test/Integration/Traits/AssertModuleIsRegisteredForReal.php +++ b/Test/Integration/Traits/AssertModuleIsRegisteredForReal.php @@ -14,7 +14,11 @@ trait AssertModuleIsRegisteredForReal protected function assertModuleIsRegisteredForReal(string $moduleName) { - $directoryList = $this->om()->create(DirectoryList::class, ['root' => BP]); // @phpstan-ignore + if (!defined('BP')) { + define('BP', __DIR__); + } + + $directoryList = $this->om()->create(DirectoryList::class, ['root' => BP]); $deploymentConfigReader = $this->om()->create(DeploymentConfigReader::class, ['dirList' => $directoryList]); $deploymentConfig = $this->om()->create(DeploymentConfig::class, ['reader' => $deploymentConfigReader]);