fixes on default app for tests
authorRoland Häder <roland@mxchange.org>
Mon, 3 Mar 2008 20:43:58 +0000 (20:43 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 3 Mar 2008 20:43:58 +0000 (20:43 +0000)
tests/contract-test.php
tests/loader-test.php
tests/personell-test.php

index 326d104272e4cc15c9ce2be526249f08f7d2c4dc..e202630baa67d9293672c254d9eb28b761a683ff 100644 (file)
@@ -12,9 +12,14 @@ require(PATH . "inc/includes.php");
 // Load all game classes
 require(PATH . "inc/classes.php");
 
-// Load more include files
-$_GET['app'] = "ship-simu";
-require_once(PATH . "inc/selector.php");
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load the "selector"
+require(PATH . "inc/selector.php");
 
 // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
 // jetzt die Personalliste wiederherstellen
index 668e612254a0e54817158dd0494d3c31f4d192eb..b1682eaf76708f15616e63a9f616cc2dafa75c42 100644 (file)
@@ -12,13 +12,19 @@ require(PATH . "inc/includes.php");
 // Load all game classes
 require(PATH . "inc/classes.php");
 
-// Load more include files
-$_GET['app'] = "ship-simu";
-require_once(PATH . "inc/selector.php");
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
 
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load the "selector"
+require(PATH . "inc/selector.php");
+
+// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
 // jetzt die Personalliste wiederherstellen
 try {
-       $test = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98");
+       $personell = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98");
 } catch (InvalidIDFormatException $e) {
        die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()
@@ -85,7 +91,7 @@ try {
 if (defined('DEBUG_PERSONELL_OBJ')) {
        DebugMiddleware::getInstance()->output(sprintf("Das Personal-Objekt sieht wie folgt aus:<br />
 <pre>%s</pre>\n",
-               print_r($test, true)
+               print_r($personell, true)
        ));
 }
 
@@ -94,7 +100,7 @@ exit();
 
 // Etwas zum Testen...
 try {
-       $test = SimulatorPersonell::createSimulatorPersonell(20);
+       $personell = SimulatorPersonell::createSimulatorPersonell(20);
 } catch (NullPointerException $e) {
        die(sprintf("[Main:] Personenliste nicht angelegt. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()
@@ -107,19 +113,19 @@ try {
        die(sprintf("[Main:] Personenliste nicht angelegt. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()
        ));
-} 
+}
 
 // Personal-Objekt debuggen
 if (defined('DEBUG_PERSONELL_OBJ')) {
        DebugMiddleware::getInstance()->output(sprintf("Das Personal-Objekt sieht wie folgt aus:<br />
 <pre>%s</pre>\n",
-               print_r($test, true)
+               print_r($personell, true)
        ));
 }
 
 // Try to save the object (for testing purposes)
 try {
-       $test->saveObjectToDatabase();
+       $personell->saveObjectToDatabase();
 } catch (NullPointerException $e) {
        die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()
index e6acd10a4706c498edd356fecc25e211a40ac29f..c49d238685d65e07cacc005549617388a19629e6 100644 (file)
@@ -12,14 +12,19 @@ require(PATH . "inc/includes.php");
 // Load all game classes
 require(PATH . "inc/classes.php");
 
-// Load more include files
-$_GET['app'] = "ship-simu";
-require_once(PATH . "inc/selector.php");
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load the "selector"
+require(PATH . "inc/selector.php");
 
 // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
 // jetzt die Personalliste wiederherstellen
 try {
-       $test = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98");
+       $personell = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98");
 } catch (InvalidIDFormatException $e) {
        die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()
@@ -86,7 +91,7 @@ try {
 if (defined('DEBUG_PERSONELL_OBJ')) {
        echo sprintf("Das Personal-Objekt sieht wie folgt aus:<br />
 <pre>%s</pre>\n",
-               print_r($test, true)
+               print_r($personell, true)
        );
 }
 
@@ -95,7 +100,7 @@ exit();
 
 // Etwas zum Testen...
 try {
-       $test = SimulatorPersonell::createSimulatorPersonell(20);
+       $personell = SimulatorPersonell::createSimulatorPersonell(20);
 } catch (NullPointerException $e) {
        die(sprintf("[Main:] Personenliste nicht angelegt. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()
@@ -108,19 +113,19 @@ try {
        die(sprintf("[Main:] Personenliste nicht angelegt. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()
        ));
-} 
+}
 
 // Personal-Objekt debuggen
 if (defined('DEBUG_PERSONELL_OBJ')) {
        echo sprintf("Das Personal-Objekt sieht wie folgt aus:<br />
 <pre>%s</pre>\n",
-               print_r($test, true)
+               print_r($personell, true)
        );
 }
 
 // Try to save the object (for testing purposes)
 try {
-       $test->saveObjectToDatabase();
+       $personell->saveObjectToDatabase();
 } catch (NullPointerException $e) {
        die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
                $e->getMessage()