mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-03-09 15:40:18 +00:00
first commit
This commit is contained in:
commit
5352a2b94a
396 changed files with 10008 additions and 0 deletions
41
code/web/backend/tests/core/ConfigTest.php
Normal file
41
code/web/backend/tests/core/ConfigTest.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
class ConfigTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/*
|
||||
* Create fake values, necessary to run the tests
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$_SERVER['HTTP_HOST'] = 'localhost';
|
||||
$_SERVER['SCRIPT_NAME'] = 'index.php';
|
||||
Config::$config = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset everything
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
putenv('APPLICATION_ENV=');
|
||||
Config::$config = null;
|
||||
}
|
||||
|
||||
public function testGetDefaultEnvironment()
|
||||
{
|
||||
// fake application constants
|
||||
putenv('APPLICATION_ENV=development');
|
||||
|
||||
// call for environment should return "development"
|
||||
$this->assertEquals('index', Config::get('DEFAULT_ACTION'));
|
||||
}
|
||||
|
||||
public function testGetFailingEnvironment()
|
||||
{
|
||||
// fake application constants
|
||||
putenv('APPLICATION_ENV=foobar');
|
||||
|
||||
// call for environment should return false because config.foobar.php does not exist
|
||||
$this->assertEquals(false, Config::get('DEFAULT_ACTION'));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue