Commit d68140f3 authored by Carsten  Rose's avatar Carsten Rose
Browse files

phpunit: fix problems.

parent cde5c7f7
Pipeline #1219 passed with stage
in 1 minute and 38 seconds
......@@ -69,7 +69,7 @@ class FillStoreForm {
$this->feSpecNative = $this->loadFormElementsBasedOnSIP();
$form = $this->store->getVar(SIP_FORM, STORE_SIP, SANITIZE_ALLOW_ALNUMX);
if (!empty($form)) {
if (!empty($form) && !defined('PHPUNIT_QFQ')) {
// To make STORE_RECORD available at a very early stage.
$recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP, SANITIZE_ALLOW_DIGIT);
$tableFromFormSql = "SELECT tableName, primaryKey FROM Form WHERE name=?";
......
......@@ -199,14 +199,18 @@ class Store {
if (self::$phpUnit) {
// if (self::$instance !== null) {
// // fake to have a clean environment for the next test.
// self::unsetStore(STORE_TYPO3);
// self::fillStoreTypo3($bodytext);
//
// self::unsetStore(STORE_CLIENT);
// self::fillStoreClient();
// }
if (self::$instance !== null && $fileConfigIni != '') {
if($fileConfigIni=='init'){
$fileConfigIni='';
}
// fake to have a clean environment for the next test.
self::unsetStore(STORE_TYPO3);
self::fillStoreTypo3($bodytext);
self::unsetStore(STORE_CLIENT);
self::fillStoreClient();
}
// Testing different config files means initialize completely
if ($fileConfigIni != '') {
......
......@@ -1189,4 +1189,13 @@ class DirtyTest extends AbstractDatabaseTest {
$this->sip->sipUniqId('badcaffee1234');
$_COOKIE[SESSION_NAME] = 'SessionCookieAlice';
}
/**
*
*/
protected function tearDown() {
parent::tearDown();
self::$mysqli->real_query("DELETE FROM Form WHERE name='form' AND id!=1000");
}
}
......@@ -39,7 +39,7 @@ class StoreTest extends TestCase {
$_GET['key04'] = '4567';
$_POST['key04'] = '5678';
$this->store = Store::getInstance("\n; some comment\n" . TYPO3_FORM . "=testformnameDoNotChange\n", true);
$this->store = Store::getInstance("\n; some comment\n" . TYPO3_FORM . "=testformnameDoNotChange\n", true, 'init');
}
......
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