Commit 04eb48ce authored by Carsten  Rose's avatar Carsten Rose
Browse files

Report: implemented flag $phpUnit

Sip: moved initialization for $phpUnit from null to false
parent 5118391b
......@@ -76,6 +76,8 @@ class QuickFormQuery {
*/
private $t3data = array(); // FormEelement Definition: all formElement.class='native' of the loaded form
private $phpUnit = false;
/*
* TODO:
* Preparation: setup logging, database access, record locking
......@@ -98,6 +100,8 @@ class QuickFormQuery {
*/
public function __construct(array $t3data = array(), $phpUnit = false) {
$this->phpUnit = $phpUnit;
mb_internal_encoding("UTF-8");
set_error_handler("\\qfq\\ErrorHandler::exception_error_handler");
......@@ -319,7 +323,7 @@ class QuickFormQuery {
* @return string
*/
private function doReport() {
$report = new Report($this->t3data, $this->store->getVar(SYSTEM_SESSIONNAME, STORE_SYSTEM));
$report = new Report($this->t3data, $this->store->getVar(SYSTEM_SESSIONNAME, STORE_SYSTEM), $this->phpUnit);
$html = $report->process();
......
......@@ -74,15 +74,19 @@ class Report {
private $t3data = array();
private $phpUnit = false;
/**
* Report constructor.
*
* @param array $t3data
*/
public function __construct(array $t3data, $sessionName) {
public function __construct(array $t3data, $sessionName, $phpUnit = false) {
$this->phpUnit = $phpUnit;
$this->t3data = $t3data;
$this->sip = new Sip($sessionName);
$this->sip = new Sip($sessionName, $phpUnit);
$this->page_control["msgbox"]["pagec"] = "Please confirm!";
......@@ -102,7 +106,7 @@ class Report {
$this->variables = new Variables($t3data["uid"]);
// Set static values, which won't change during this run.
$this->fr_error["pid"] = $this->variables->resultArray['global.']['page_id'];
$this->fr_error["pid"] = isset($this->variables->resultArray['global.']['page_id']) ? $this->variables->resultArray['global.']['page_id'] : 0;
$this->fr_error["uid"] = $t3data["uid"];
$this->fr_error["debug_level"] = 0;
......
......@@ -27,7 +27,7 @@ class Sip {
// $_SESSION[$sip] => <urlparam> >> $_SESSION['badcaffee1234'] => 'form=Person&r=1&z=5678'
// $_SESSION[$urlparam] => <sip> >> $_SESSION['form=Person&r=1&z=5678'] => 'badcaffee1234'
private $phpUnit = null;
private $phpUnit = false;
private $staticUniqId = false;
function __construct($sessionname, $phpUnit = false) {
......
......@@ -8,7 +8,7 @@
namespace qfq;
require_once(__DIR__ . '/../../qfq/helper/SANITIZE.php');
require_once(__DIR__ . '/../../qfq/helper/Sanitize.php');
require_once(__DIR__ . '/../../qfq/exceptions/CodeException.php');
......@@ -51,7 +51,7 @@ class SanitizeTest extends \PHPUnit_Framework_TestCase {
*
*/
public function testSanitizeException() {
Sanitize::sanitize('Hello World', 'invalid SANITIZE class');
Sanitize::sanitize('Hello World', 'invalid sanitize class');
}
}
Markdown is supported
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