Key stroke (RETURN) required
[shipsimu.git] / tests / ConfigTest.php
index 84b245d49677cf2768a01e47ec305864946a0c8a..1091a5b8a9ebd105d4aa5944eb4856c0e6785a92 100644 (file)
@@ -1,28 +1,51 @@
 <?php
+print (basename(__FILE__).": Init...\n");
+
 // Change directory
 @chdir("..");
 
 // Load config file
-require(dirname(dirname(__FILE__)) . "/inc/config.php");
+require(dirname(dirname(__FILE__)) . '/inc/config.php');
 
 // Load all include files
-require(PATH . "inc/includes.php");
+require(PATH . 'inc/includes.php');
 
 // Load all game classes
-require(PATH . "inc/classes.php");
+require(PATH . 'inc/classes.php');
 
 // Set default application
-FrameworkConfiguration::getInstance()->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 <webmaster@mxchange.org>
+ * @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 <http://www.gnu.org/licenses/>.
  */
 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);