From 73dab16efbc4c904dfef502c0da69c92af793513 Mon Sep 17 00:00:00 2001 From: Adrien Barreau Date: Fri, 31 Mar 2023 17:12:25 +0000 Subject: [PATCH] test: skip functional tests if no credentials are provided Signed-off-by: Adrien Barreau --- tests/ApiFunctionalTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/ApiFunctionalTest.php b/tests/ApiFunctionalTest.php index 97b692b..5c0de7c 100644 --- a/tests/ApiFunctionalTest.php +++ b/tests/ApiFunctionalTest.php @@ -86,6 +86,13 @@ class ApiFunctionalTest extends TestCase */ protected function setUp() :void { + foreach (['APP_KEY', 'APP_SECRET', 'CONSUMER', 'ENDPOINT'] as $envName) { + if (!getenv($envName)) { + $this->markTestSkipped("Skip test due to missing $envName variable"); + return; + } + } + $this->application_key = getenv('APP_KEY'); $this->application_secret = getenv('APP_SECRET'); $this->consumer_key = getenv('CONSUMER');