Skip to content
Snippets Groups Projects
Commit faec5d21 authored by Carsten  Rose's avatar Carsten Rose
Browse files

AbstractDatabaseTest.php: source reformatted

BuildFormPlainTest.php: fixed issue with double declared class FakeTSFE.
ReportTest.php: initially created.
parent b6175173
No related branches found
No related tags found
No related merge requests found
...@@ -16,14 +16,17 @@ require_once(__DIR__ . '/../../qfq/store/Store.php'); ...@@ -16,14 +16,17 @@ require_once(__DIR__ . '/../../qfq/store/Store.php');
* Class AbstractDatabaseTest * Class AbstractDatabaseTest
*/ */
abstract class AbstractDatabaseTest extends PHPUnit_Framework_TestCase { abstract class AbstractDatabaseTest extends PHPUnit_Framework_TestCase {
/** /**
* @var null * @var null
*/ */
static protected $mysqli = null; static protected $mysqli = null;
/** /**
* @var qfq\Database * @var qfq\Database
*/ */
protected $db = null; protected $db = null;
/* /*
* @var qfq\Store * @var qfq\Store
*/ */
......
...@@ -360,7 +360,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest { ...@@ -360,7 +360,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
$this->executeSQLFile(__DIR__ . '/fixtures/Generic.sql', true); $this->executeSQLFile(__DIR__ . '/fixtures/Generic.sql', true);
// $this->executeSQLFile(__DIR__ . '/fixtures/TestFormEditor.sql', true); // $this->executeSQLFile(__DIR__ . '/fixtures/TestFormEditor.sql', true);
$GLOBALS["TSFE"] = new FakeTSFE(); $GLOBALS["TSFE"] = new FakeTSFEBuildPlain();
// $this->form = new \qfq\QuickFormQuery(['bodytext' => "form=form\nr=3", 'uid' => 1234], true); // $this->form = new \qfq\QuickFormQuery(['bodytext' => "form=form\nr=3", 'uid' => 1234], true);
$form = new \qfq\QuickFormQuery(['bodytext' => "form=form\nr=3", 'uid' => 1234], true); $form = new \qfq\QuickFormQuery(['bodytext' => "form=form\nr=3", 'uid' => 1234], true);
...@@ -371,7 +371,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest { ...@@ -371,7 +371,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
} }
} }
class FakeTSFE { class FakeTSFEBuildPlain {
public $id = 1; public $id = 1;
public $type = 1; public $type = 1;
public $sys_language_uid = 1; public $sys_language_uid = 1;
......
<?php
//namespace qfq;
//use qfq;
require_once(__DIR__ . '/AbstractDatabaseTest.php');
require_once(__DIR__ . '/../../qfq/report/Report.php');
require_once(__DIR__ . '/../../qfq/store/Store.php');
require_once(__DIR__ . '/../../qfq/Evaluate.php');
/**
* Created by PhpStorm.
* User: crose
* Date: 2/2/16
* Time: 10:07 PM
*/
class ReportTest extends AbstractDatabaseTest {
/**
* @var Evaluate
*/
private $eval = null;
/**
* @var Report
*/
private $report = null;
/**
*
*/
public function testReportHead() {
$bodyText = '10.head = Hello world';
$result = $this->report->process($bodyText);
$this->assertEquals('', $result);
}
/**
* @throws Exception
*/
protected function setUp() {
parent::setUp();
$GLOBALS["TSFE"] = new FakeTSFEReport();
$this->eval = new qfq\Evaluate($this->store, $this->db);
$this->report = new qfq\Report(array(), $this->store->getVar(SYSTEM_SESSION_NAME, STORE_SYSTEM), $this->eval, true);
$this->executeSQLFile(__DIR__ . '/fixtures/Generic.sql', true);
}
}
class FakeTSFEReport {
public $id = 1;
public $type = 1;
public $sys_language_uid = 1;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment