|
@@ -0,0 +1,26 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+
|
|
|
|
|
+namespace Opentalent\OtCore\Tests\Unit\Service;
|
|
|
|
|
+
|
|
|
|
|
+use Nimut\TestingFramework\TestCase\UnitTestCase;
|
|
|
|
|
+use Opentalent\OtCore\Service\OpentalentEnvService;
|
|
|
|
|
+
|
|
|
|
|
+class OpentalentEnvServiceTest extends UnitTestCase
|
|
|
|
|
+{
|
|
|
|
|
+ /**
|
|
|
|
|
+ * get should return the requested variable default value,
|
|
|
|
|
+ * or the overridden one if $GLOBALS have been set
|
|
|
|
|
+ *
|
|
|
|
|
+ * @test
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get() {
|
|
|
|
|
+ $this->assertEquals('https://api.opentalent.fr', OpentalentEnvService::get('API_BASE_URI'));
|
|
|
|
|
+ $this->assertEquals('prod-back', OpentalentEnvService::get('DB_HOST'));
|
|
|
|
|
+ $this->assertEquals('dbcloner', OpentalentEnvService::get('DB_USER'));
|
|
|
|
|
+ $this->assertEquals('wWZ4hYcrmHLW2mUK', OpentalentEnvService::get('DB_PASSWORD'));
|
|
|
|
|
+
|
|
|
|
|
+ $GLOBALS['OT']['API_BASE_URI'] = 'https://local.api.opentalent.fr';
|
|
|
|
|
+
|
|
|
|
|
+ $this->assertEquals('https://local.api.opentalent.fr', OpentalentEnvService::get('API_BASE_URI'));
|
|
|
|
|
+ }
|
|
|
|
|
+}
|