X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=tests%2FConfigTest.php;h=1091a5b8a9ebd105d4aa5944eb4856c0e6785a92;hp=84b245d49677cf2768a01e47ec305864946a0c8a;hb=1b7df549b9e8eb283d201606489c0e388c7917a2;hpb=0a1cf9ca77543f5acf09a2b5ada753277e47f6d4 diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 84b245d496..1091a5b8a9 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -1,28 +1,51 @@ setConfigEntry("default_application", "ship-simu"); +FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); // Set testing mode (no starter.php will be loaded!) define('TEST_MODE', true); // Load the PHPUnit framework -require_once("PHPUnit/Framework.php"); +require_once('PHPUnit/Framework.php'); + +print (basename(__FILE__).": Init completed.\n\n"); /** * A test case for the configuration sub system * + * @author Roland Haeder + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * @see http://www.phpunit.de + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ class ConfigTest extends PHPUnit_Framework_TestCase { /** @@ -39,7 +62,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase { $cfg = FrameworkConfiguration::getInstance(); // Now find a configuration variable that does not exist - $dummy = $cfg->readConfig("does_not_exist"); + $dummy = $cfg->readConfig('does_not_exist'); } catch (ConfigEntryNotFoundException $expected) { // This exception was expected, so it is fine $testPassed = true; @@ -97,7 +120,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase { $cfg = FrameworkConfiguration::getInstance(); // Try to read an empty configuration variable - $cfg->setConfigEntry("", "will_never_be_set"); + $cfg->setConfigEntry("", 'will_never_be_set'); } catch (ConfigEntryIsEmptyException $expected) { // This exception was expected, so it is fine $testPassed = true; @@ -125,10 +148,10 @@ class ConfigTest extends PHPUnit_Framework_TestCase { $cfg = FrameworkConfiguration::getInstance(); // Try to read an empty configuration variable - $cfg->setConfigEntry("test_key", "{$value}"); + $cfg->setConfigEntry('test_key', "{$value}"); // Read the config entry we have just written - $readValue = $cfg->readConfig("test_key"); + $readValue = $cfg->readConfig('test_key'); // Now test the values $this->assertEquals($value, $readValue);