Commit 02e87cb5 authored by Carsten  Rose's avatar Carsten Rose
Browse files

form.php: integrated Database()

index.php: tried to make phpunit tests all running - no success, but changes are still meaningfull.
parent e99f9df3
......@@ -30,9 +30,12 @@
<body>
<?php
include("t3/form.php");
require_once("t3/form.php");
require_once("qfq/Constants.php"); // just for the debug string below to simulate the t3 bodytext
//qfq\renderForm("\n# some notes\ndebugLoad = 5\n debugSave = 0\n form = mytestform");
qfq\renderForm("\n; some comment\n" . T3_BODYTEXT_FORM . "=testformnameDoNotChange\n" . T3_BODYTEXT_DEBUG_SAVE . "=6\n" . T3_BODYTEXT_DEBUG_LOAD . "=7\n");
qfq\renderForm("\n# some notes\ndebugLoad = 5\n debugSave = 0\n form = mytestform");
?>
......
......@@ -9,11 +9,14 @@
namespace qfq;
use qfq;
use qfq\exceptions;
use qfq\exceptions\UserException;
use qfq\exceptions\CodeException;
use qfq\exceptions\DbException;
require_once(__DIR__ . '/../qfq/Form.php');
require_once(__DIR__ . '/../qfq/exceptions/UserException.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../qfq/exceptions/DbException.php');
//TODO: unit tests fuer alle abgefangenen Exceptions
......@@ -31,11 +34,14 @@ function renderForm($bodytext = "") {
echo $form->process();
echo "test";
} catch (UserException $e) {
echo $e->formatMessage();
} catch (CodeException $e) {
echo $e->formatMessage();
} catch (Exception $e) {
} catch (DbException $e) {
echo $e->formatMessage();
} catch (\Exception $e) {
echo "Generic Exception: " . $e->getMessage();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment