From: Roland Häder Date: Sat, 17 May 2008 21:07:26 +0000 (+0000) Subject: Invalid tests removed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a8aae18024cbd98944a060b9122339a4bcb2b119;p=mailer.git Invalid tests removed --- diff --git a/.gitattributes b/.gitattributes index dbcf438de5..699d7f1e85 100644 --- a/.gitattributes +++ b/.gitattributes @@ -230,6 +230,3 @@ templates/de/code/footer_msg.ctp -text templates/de/code/header.ctp -text templates/de/html/.htaccess -text tests/ConfigTest.php -text -tests/old/contract-test.php -text -tests/old/loader-test.php -text -tests/old/personell-test.php -text diff --git a/tests/old/contract-test.php b/tests/old/contract-test.php deleted file mode 100644 index 4b205fc793..0000000000 --- a/tests/old/contract-test.php +++ /dev/null @@ -1,612 +0,0 @@ -setConfigEntry("default_application", "ship-simu"); -$application = "ship-simu"; - -// Load more includes -require(PATH . "application/ship-simu/loader.php"); - -// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen -// jetzt die Personalliste wiederherstellen -try { - $personell = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98"); -} catch (InvalidIDFormatException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (FileIsEmptyException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (FilePointerNotOpenedException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidMD5ChecksumException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidDataLengthException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidSimulatorIDException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (MismatchingCompressorsException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerItemIsNullException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerItemIsNoArrayException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerMaybeDamagedException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} - -// Personal-Objekt debuggen -if (defined('DEBUG_PERSONELL_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:
-
%s
\n", - print_r($personell, true) - )); -} - -// Hafen bauen -$harbor = Harbor::createHarbor("Hamburger Hafen"); - -// Name ausgeben -DebugMiddleware::getInstance()->output(sprintf("Der %s ist gegründet worden.
\n", - $harbor->getHarborName() -)); - -// Hafen-Objekt debuggen -if (defined('DEBUG_HARBOR_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("Der %s sieht wie folgt aus:
-
%s
\n", - $harbor->getHarborName(), - print_r($harbor, true) - )); -} - -// Haendler gruenden -$merchant = Merchant::createMerchant("Namenlos", $harbor); - -// Array mit Einbauten erstellen -$einbauten = array( - 'parts' => array( // *** Die zu einbauenden Schiffsteile *** - 'Motor' => array( // --- Maschinenraum mit Motor --- - "Ocean-Power 2000", // Bezeichnung - 20000, // Pferdestaerken - 6, // Anzahl Nocken - 2.5, 2, 3.5 // Abmasse (Breite/Hoehe/Laenge) - ), - 'Bridge' => array( // --- Kommandobruecke --- - 26, 2.5, 15 // Abmasse (Breite/Hoehe/Laenge) - ), - 'CarDeck' => array( // --- Autodecks --- - 'amount' => 8, // Anzahl Autodecks (einige liegen hintereinander im selben Deck!) - 'dim' => array( // Abmessung (Breite/Hoehe/Laenge) - 6, 3, 16 - ) - ), - 'TruckDeck' => array( // --- Decks fuer LKW/Busse haben vielleicht ein anderes Belueftgungssystem, etc. --- - 'amount' => 1, // Anzahl der Decks - 'dim' => array( // Abmessung (Breite/Hoehe/Laenge) - 8, 5, 195 // Geht durchs gesamte Schiff! - ) - ), - 'TrainDeck' => array( // --- Decks fuer Zuege haben Schienen... --- - 'amount' => 1, // Anzahl der Decks - 'dim' => array( // Abmessung (Breite/Hoehe/Laenge) - 8, 4, 195 // Geht durchs gesamte Schiff! - ) - ), - 'LuxuryCabin' => array( // --- Luxuskabinen --- - 'amount' => 20, // Anzahl Luxuskabinen im Schiff - 'rooms' => 4, // Raeume: 2 Schlafzimmer, 1 Auffenthaltszimmer, 1 Bad mit Dusche/Toilette/Waschbecken - 'bed' => 3, // Anzahl Betten (1 Doppelbett 2 Einzelbetten, Doppel-/Einzelbetten in getrennte Raeume) - 'dim' => array( // Abmessung der Luxuskabine (Breite/Hoehe/Laenge) - 4, 3, 5 - ), - ), - 'PremierCabin' => array( // --- Mittlere Kabinen --- - 'amount' => 40, // Anzahl - 'rooms' => 2, // Raeume: Schlafzimmer, Bad mit Toilette/Waschbecken - 'bed' => 2, // Anzahl Betten (1 Doppelbett, 1 Einzelbett; gemeinsamer Raum) - 'dim' => array( // Abmessungen der Kabine (Breite/Hoehe/Laenge) - 4, 2.5, 4 - ) - ), - 'LowCabin' => array( // --- Untere Kabinen (befinden sich in den Unterbauten) --- - 'amount' => 90, // Anzahl - 'rooms' => 1, // Raeume: Schlafzimmer, Waschbecken - 'bed' => 2, // Anzahl Betten (2 Etagenbetten) - 'dim' => array( // Abmessungen der Kabine (Breite/Hoehe/Laenge) - 3, 2.5, 4 - ) - ), - 'EconomyCabin' => array( // --- Unterste Kabinen (befinden sich tief unten im Schiffsbauch) --- - 'amount' => 140, // Anzahl - 'rooms' => 1, // Raeume: Schlafzimmer, Waschbecken - 'bed' => 1, // Anzahl Betten (1 Etagenbett) - 'dim' => array( // Abmessungen der Kabine (Breite/Hoehe/Laenge) - 2, 2.5, 2 - ) - ) - ), - 'builds' => array( // *** Welche Oberklasse verwendet werden sollen *** - 'Motor' => "MaschineRoom", - 'Bridge' => "BaseUpperStructure", - 'LuxuryCabin' => "BaseCabin", - 'PremierCabin' => "BaseCabin", - 'LowCabin' => "BaseCabin", - 'EconomyCabin' => "BaseCabin", - 'CarDeck' => "BaseDeck", - 'TrainDeck' => "BaseDeck", - 'TruckDeck' => "BaseDeck" - ) -); - -// Preisliste auffuellen -foreach ($einbauten['parts'] as $key=>$part) { - // Create item array string - $item = ""; - foreach ($part as $idx=>$itemPart) { - if (is_string($itemPart)) { - // String found - $item .= sprintf("\"%s\", ", $itemPart); - } elseif (is_int($itemPart)) { - // Integer found - $item .= sprintf("%d, ", $itemPart); - } elseif (is_float($itemPart)) { - // Float found - $item .= sprintf("%f, ", $itemPart); - } elseif (is_array($itemPart)) { - // Sub-array found - $item .= "array("; - - // Go all items through - foreach ($itemPart as $idx2=>$subPart) { - if (is_int($subPart)) { - // Integer again found - $item .= sprintf("%d, ", $subPart); - } elseif (is_float($subPart)) { - // Float found - $item .= sprintf("%f, ", $subPart); - } else { - // Unsupport part found - die(sprintf("[Main:] Unsupported sub-array element on pos %d in array %s found: %s", $idx2, $idx, $subPart)); - } - } - - // Remove trailing comma - $item = substr($item, 0, -2); - - // Add closing bracket - $item .= "), "; - } else { - // Unsupport part found - die(sprintf("[Main:] Unsupported array element on pos %d: %s", $idx, $itemPart)); - } - } - - // Remove trailing comma - $item = substr($item, 0, -2); - - // Random price - $price = mt_rand(5, 12) * 10000; - - // Give it a try... - try { - // Generate command for adding objects to a price list - $eval = sprintf("\$merchant->addItemToPriceList(%s::create%s(%s), %d);", - $key, - $key, - $item, - $price - ); - - // Debug message - if ((defined('DEBUG_EVAL')) || (defined('DEBUG_ALL'))) DebugMiddleware::getInstance()->output(sprintf("[Main:] Konstruierte PHP-Anweisung:
%s

\n", - htmlentities($eval) - )); - - // Run the constructed command - eval($eval); - } catch (ItemNotTradeableException $e) { - die(sprintf("[Main:] Die Preisliste des Händlers %s kann nicht befüllt werden. Grund: %s
\n", - $merchant->getMerchantName(), - $e->getMessage() - )); - } -} - -// Haendler-Objekt debuggen -if (defined('DEBUG_MERCHANT_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("Der Händler %s sieht wie folgt aus:
-
%s
\n", - $merchant->getMerchantName(), - print_r($merchant, true) - )); -} - -// Reederei gruenden -$shipping = ShippingCompany::createShippingCompany("Hanseatic Travel Company", $harbor); - -// Firmenschef setzen -try { - $shipping->setCompanyFounder(CompanyEmployee::createCompanyEmployee("Roland", "Häder", "M", 1977, 9, 26, true, 2000)); -} catch (BirthdayInvalidException $e) { - die(sprintf("[Main:] Reederei-Gründer konnte nicht gesetzt werden. Grund: %s
\n", - $e->getMessage() - )); -} - -// Dann mal ausgeben... -DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s ist von %s %s gegründet worden.
\n", - $shipping->getCompanyName(), - $shipping->getFounderInstance()->getSurname(), - $shipping->getFounderInstance()->getFamily() -)); - -// Die Reederei stellt Personal ein und bedient sich an der $personell-Instanz -try { - $shipping->recruitRandomEmployees(10, $personell); -} catch (ToMuchEmployeesException $e) { - die(sprintf("[Main:] Die Reederei %s konnte kein Personal einstellen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (OutOfBoundsException $e) { - die(sprintf("[Main:] Die Reederei %s konnte kein Personal einstellen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} - -// Anzahl Personal ausgeben -DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s hat nun %d weitere Mitarbeiter.
\n", - $shipping->getCompanyName(), - $shipping->getTotalEmployee() -)); - -// Dann die ersten 3 Werften in den Hafen einbauen und Personal zuweisen -$shipping->createShipyardInHarbor("Werft 1", $harbor); -$shipping->createShipyardInHarbor("Werft 2", $harbor); -$shipping->createShipyardInHarbor("Werft 3", $harbor); - -// In alle Werften sollen Passagierschiffe gebaut werden koennen -try { - $shipping->addShipTypeToAllShipyards("PassengerShip"); -} catch (ClassNotFoundException $e) { - die(sprintf("[Main:] Die Reederei %s kann ihre Werften nicht beschäftigen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (ClassMismatchException $e) { - die(sprintf("[Main:] Die Reederei %s kann ihre Werften nicht beschäftigen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Die Reederei %s kann ihre Werften nicht beschäftigen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} - -// Personal auf die Werften verteilen -try { - $shipping->distributeAllPersonellOnShipyards(); -} catch (NoShipyardsConstructedException $e) { - die(sprintf("[Main:] Die Reederei %s konnte kein Personal den Werften zuteilen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (ClassMismatchException $e) { - die(sprintf("[Main:] Die Reederei %s konnte kein Personal den Werften zuteilen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Die Reederei %s konnte kein Personal den Werften zuteilen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Die Reederei %s konnte kein Personal den Werften zuteilen. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} - -// Normale Meldung ausgeben -DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s beschäftigt nun ihre %d Mitarbeiter in %d Werft(en):
\n", - $shipping->getCompanyName(), - $shipping->getTotalEmployee(), - $shipping->getTotalShipyards() -)); - -// Dann nimmt die Reederei ihren ersten Bauauftrag entgegen. -// Sie muss auch sich selber Bauauftraege erteilen! -try { - $shipping->addNewWorksContract(WorksContract::createWorksContract("PassengerShip", "M/S Poseidon", $shipping)); -} catch (ClassNotFoundException $e) { - die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: %s
\n", - $e->getMessage() - )); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: %s
\n", - $e->getMessage() - )); -} catch (EmptyStructuresListException $e) { - die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: %s
\n", - $e->getMessage() - )); -} - -// Auftrag-Instanz holen -$contract = $shipping->getLastContractInstance(); - -// Die Reederei hat einen Haendler gewaehlt -try { - $shipping->setMerchantInstance($merchant); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Der Händler %s konnte nicht ausgewählt werden. Grund: %s
\n", - $merchant->getMerchantName(), - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Der Händler %s konnte nicht ausgewählt werden. Grund: %s
\n", - $merchant->getMerchantName(), - $e->getMessage() - )); -} catch (ClassMismatchException $e) { - die(sprintf("[Main:] Der Händler %s konnte nicht ausgewählt werden. Grund: %s
\n", - $merchant->getMerchantName(), - $e->getMessage() - )); -} - -// Den Bauauftrag mit der Reederei abgleichen, ob sie den Schiffstyp bauen koennen -try { - $typeValid = $shipping->validateWorksContractShipType($contract); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Die Reederei %s konnte den Bauauftrag nicht validieren. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Die Reederei %s konnte den Bauauftrag nicht validieren. Grund: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} - -// Kann gebaut werden? -if ($typeValid) { - DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s kann Schiffe vom Typ %s bauen.
\n", - $shipping->getCompanyName(), - $contract->getShipInstance()->getObjectDescription() - )); -} else { - DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s kann keine Schiffe vom Typ %s bauen!
\n", - $shipping->getCompanyName(), - $contract->getShipInstance()->getObjectDescription() - )); - exit; -} - -// Dann den Bauauftrag verfeinern -foreach ($einbauten['parts'] as $key=>$part) { - try { - $contract->addContractDetails($key, $einbauten['builds'][$key], $part); - } catch (ShipPartNotConstructableException $e) { - // Output message - die($e->getMessage()); - } catch (ShipNotConstructedException $e) { - // Output message - die($e->getMessage()); - } catch (ItemNotInPriceListException $e) { - die(sprintf("[Main:] Der Artikel %s konnte nicht in der Preisliste gefunden werden. Grund: %s
\n", - $key, - $e->getMessage() - )); - } catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Der Artikel %s konnte nicht in der Preisliste gefunden werden. Grund: %s
\n", - $key, - $e->getMessage() - )); - } -} - -// Reederei-Objekt ausgeben -if (defined('DEBUG_COMPANY_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s sieht wie folgt aus:
-
%s
\n", - $shipping->getCompanyName(), - print_r($shipping, true) - )); -} - -// Clean up a little -unset($einbauten); -unset($part); -unset($eval); -unset($item); -unset($key); -unset($typeValid); - -// Gesamtwert ausgeben -try { - $totalValue = $contract->getTotalPrice(); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: %s
\n", - $e->getMessage() - )); -} catch (EmptyStructuresListException $e) { - die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: %s
\n", - $e->getMessage() - )); -} catch (TotalPriceNotCalculatedException $e) { - die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: %s
\n", - $e->getMessage() - )); -} - -// Wert ausgeben -DebugMiddleware::getInstance()->output(sprintf("Der Bau der %s wird der Reederei %s voraussichtlich %s kosten.
\n", - $contract->getShipInstance()->getShipName(), - $shipping->getCompanyName(), - $contract->formatCurrency($totalValue) -)); - -// Clean up a little -unset($totalValue); - -// Den Bauvertrag unterschreiben (damit wird er in den Bau-Queue aufgenommen) -try { - $shipping->signContract($contract, $shipping); -} catch (NullPointerException $e) { - die(sprintf("[Main:] The shipping company %s was not able to sign the contract for the following reason: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] The shipping company %s was not able to sign the contract for the following reason: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] The shipping company %s was not able to sign the contract for the following reason: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (InvalidContractPartnerException $e) { - die(sprintf("[Main:] The shipping company %s was not able to sign the contract for the following reason: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (ContractAllreadySignedException $e) { - die(sprintf("[Main:] The shipping company %s was not able to sign the contract for the following reason: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} catch (WrongContractPartnerException $e) { - die(sprintf("[Main:] The shipping company %s was not able to sign the contract for the following reason: %s
\n", - $shipping->getCompanyName(), - $e->getMessage() - )); -} - -// Meldung ausgeben -if ($contract->isSigned()) { - DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s hat den Bau der %s zugestimmt.
\n", - $shipping->getCompanyName(), - $contract->getShipInstance()->getShipName() - )); -} else { - DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s hat den Bau der %s abgelehnt.
\n", - $shipping->getCompanyName(), - $contract->getShipInstance()->getShipName() - )); - exit; -} - -// Auftrag-Objekt ausgeben -if (defined('DEBUG_CONTRACT_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("Der Bauauftrag sieht wie folgt aus:
-
%s
\n", - print_r($contract, true) - )); -} - -// Erstmal bis hier hin... -//exit(); - -// Anzahl Betten ermitteln -try { - $totalBeds = $contract->getShipInstance()->calcTotalBeds(); -} catch (StructuresOutOfBoundsException $e) { - die(sprintf("[Main:] Anzahl Betten konnten nicht ermittelt werden. Grund: %s
\n", - $e->getMessage() - )); -} catch (EmptyStructuresListException $e) { - die(sprintf("[Main:] Anzahl Betten konnten nicht ermittelt werden. Grund: %s
\n", - $e->getMessage() - )); -} - -// Bettenanzahl ausgeben -DebugMiddleware::getInstance()->output(sprintf("Es stehen %d Betten zur Verfügung.", - $totalBeds -)); - -// -?> diff --git a/tests/old/loader-test.php b/tests/old/loader-test.php deleted file mode 100644 index 0f415eec40..0000000000 --- a/tests/old/loader-test.php +++ /dev/null @@ -1,170 +0,0 @@ -setConfigEntry("default_application", "ship-simu"); -$application = "ship-simu"; - -// Load more includes -require(PATH . "application/ship-simu/loader.php"); - -// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen -// jetzt die Personalliste wiederherstellen -try { - $personell = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98"); -} catch (InvalidIDFormatException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (FileIsEmptyException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (FilePointerNotOpenedException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidMD5ChecksumException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidDataLengthException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidSimulatorIDException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (MismatchingCompressorsException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerItemIsNullException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerItemIsNoArrayException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerMaybeDamagedException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} - -// Personal-Objekt debuggen -if (defined('DEBUG_PERSONELL_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:
-
%s
\n", - print_r($personell, true) - )); -} - -// Erstmal bis hier hin -exit(); - -// Etwas zum Testen... -try { - $personell = SimulatorPersonell::createSimulatorPersonell(20); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Personal list not created for following reason: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Personal list not created for following reason: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Personal list not created for following reason: %s
\n", - $e->getMessage() - )); -} - -// Personal-Objekt debuggen -if (defined('DEBUG_PERSONELL_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:
-
%s
\n", - print_r($personell, true) - )); -} - -// Try to save the object (for testing purposes) -try { - $personell->saveObjectToDatabase(); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidObjectException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (UnsupportedLimitationPartException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (GetterNotFoundException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (NoArrayCreatedException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} - -// -?> diff --git a/tests/old/personell-test.php b/tests/old/personell-test.php deleted file mode 100644 index 8ac3b71d23..0000000000 --- a/tests/old/personell-test.php +++ /dev/null @@ -1,170 +0,0 @@ -setConfigEntry("default_application", "ship-simu"); -$application = "ship-simu"; - -// Load more includes -require(PATH . "application/ship-simu/loader.php"); - -// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen -// jetzt die Personalliste wiederherstellen -try { - $personell = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98"); -} catch (InvalidIDFormatException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (FileIsEmptyException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (FilePointerNotOpenedException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidMD5ChecksumException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidDataLengthException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidSimulatorIDException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (MismatchingCompressorsException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerItemIsNullException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerItemIsNoArrayException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} catch (ContainerMaybeDamagedException $e) { - die(sprintf("[Main:] Could not create personal list for follwing reason: %s
\n", - $e->getMessage() - )); -} - -// Personal-Objekt debuggen -if (defined('DEBUG_PERSONELL_OBJ')) { - echo sprintf("The personal object looks like this:
-
%s
\n", - print_r($personell, true) - ); -} - -// Erstmal bis hier hin -exit(); - -// Etwas zum Testen... -try { - $personell = SimulatorPersonell::createSimulatorPersonell(20); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Personal list not created for following reason: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Personal list not created for following reason: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Personal list not created for following reason: %s
\n", - $e->getMessage() - )); -} - -// Personal-Objekt debuggen -if (defined('DEBUG_PERSONELL_OBJ')) { - echo sprintf("The personal object looks like this:
-
%s
\n", - print_r($personell, true) - ); -} - -// Try to save the object (for testing purposes) -try { - $personell->saveObjectToDatabase(); -} catch (NullPointerException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (NoObjectException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidObjectException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (MissingMethodException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (UnsupportedLimitationPartException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (GetterNotFoundException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (NoArrayCreatedException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} catch (InvalidArrayCountException $e) { - die(sprintf("[Main:] Object not saved for following reason: %s
\n", - $e->getMessage() - )); -} - -// -?>