Skip to content
Snippets Groups Projects
Commit d4083071 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Move Utils_ConfigTest to SimpleSAML\Test\Utils\ConfigTest.

parent b5c12019
No related branches found
No related tags found
No related merge requests found
<?php <?php
namespace SimpleSAML\Test\Utils;
use SimpleSAML\Utils\Config;
/** /**
* Tests for SimpleSAML\Utils\Config * Tests for SimpleSAML\Utils\Config
*/ */
class Utils_ConfigTest extends PHPUnit_Framework_TestCase class ConfigTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
...@@ -13,22 +17,24 @@ class Utils_ConfigTest extends PHPUnit_Framework_TestCase ...@@ -13,22 +17,24 @@ class Utils_ConfigTest extends PHPUnit_Framework_TestCase
{ {
// clear env var // clear env var
putenv('SIMPLESAMLPHP_CONFIG_DIR'); putenv('SIMPLESAMLPHP_CONFIG_DIR');
$configDir = \SimpleSAML\Utils\Config::getConfigDir(); $configDir = Config::getConfigDir();
$this->assertEquals($configDir, dirname(dirname(dirname(dirname(__DIR__)))) . '/config'); $this->assertEquals($configDir, dirname(dirname(dirname(dirname(__DIR__)))) . '/config');
} }
/** /**
* Test valid dir specified by env var overrides default config dir * Test valid dir specified by env var overrides default config dir
*/ */
public function testEnvVariableConfigDir() public function testEnvVariableConfigDir()
{ {
putenv('SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__); putenv('SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
$configDir = \SimpleSAML\Utils\Config::getConfigDir(); $configDir = Config::getConfigDir();
$this->assertEquals($configDir, __DIR__); $this->assertEquals($configDir, __DIR__);
} }
/** /**
* Test invalid dir specified by env var results in a thrown exception * Test invalid dir specified by env var results in a thrown exception
*/ */
...@@ -44,6 +50,6 @@ class Utils_ConfigTest extends PHPUnit_Framework_TestCase ...@@ -44,6 +50,6 @@ class Utils_ConfigTest extends PHPUnit_Framework_TestCase
'Given: "' . $invalidDir . '"' 'Given: "' . $invalidDir . '"'
); );
\SimpleSAML\Utils\Config::getConfigDir(); Config::getConfigDir();
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment