['test' => ['level' => 'debug']]]; protected $cloudinaryUrl; private $cldUrlEnvBackup; public function setUp() { parent::setUp(); $this->cldUrlEnvBackup = getenv(Configuration::CLOUDINARY_URL_ENV_VAR); self::assertNotEmpty($this->cldUrlEnvBackup, 'Please set up CLOUDINARY_URL before running tests!'); $this->cloudinaryUrl = 'cloudinary://' . $this::API_KEY . ':' . $this::API_SECRET . '@' . $this::CLOUD_NAME; putenv(Configuration::CLOUDINARY_URL_ENV_VAR . '=' . $this->cloudinaryUrl); $config = ConfigUtils::parseCloudinaryUrl(getenv(Configuration::CLOUDINARY_URL_ENV_VAR)); $config = array_merge($config, self::TEST_LOGGING); Configuration::instance()->init($config); Configuration::instance()->url->analytics(false); // disable analytics for all unit tests } public function tearDown() { parent::tearDown(); putenv(Configuration::CLOUDINARY_URL_ENV_VAR . '=' . $this->cldUrlEnvBackup); } protected static function clearEnvironment() { putenv(Configuration::CLOUDINARY_URL_ENV_VAR); // unset CLOUDINARY_URL Configuration::instance()->init(); } }