1
0
mirror of https://github.com/ovh/php-ovh.git synced 2023-11-05 03:20:26 +01:00

test: skip functional tests if no credentials are provided

Signed-off-by: Adrien Barreau <adrien.barreau@ovhcloud.com>
This commit is contained in:
Adrien Barreau 2023-03-31 17:12:25 +00:00
parent 255b26a56e
commit 73dab16efb

View File

@ -86,6 +86,13 @@ class ApiFunctionalTest extends TestCase
*/ */
protected function setUp() :void 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_key = getenv('APP_KEY');
$this->application_secret = getenv('APP_SECRET'); $this->application_secret = getenv('APP_SECRET');
$this->consumer_key = getenv('CONSUMER'); $this->consumer_key = getenv('CONSUMER');