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 { ...@@ -69,7 +69,7 @@ class FillStoreForm {
$this->feSpecNative = $this->loadFormElementsBasedOnSIP(); $this->feSpecNative = $this->loadFormElementsBasedOnSIP();
$form = $this->store->getVar(SIP_FORM, STORE_SIP, SANITIZE_ALLOW_ALNUMX); $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. // To make STORE_RECORD available at a very early stage.
$recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP, SANITIZE_ALLOW_DIGIT); $recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP, SANITIZE_ALLOW_DIGIT);
$tableFromFormSql = "SELECT tableName, primaryKey FROM Form WHERE name=?"; $tableFromFormSql = "SELECT tableName, primaryKey FROM Form WHERE name=?";
......
...@@ -199,14 +199,18 @@ class Store { ...@@ -199,14 +199,18 @@ class Store {
if (self::$phpUnit) { if (self::$phpUnit) {
// if (self::$instance !== null) { if (self::$instance !== null && $fileConfigIni != '') {
// // fake to have a clean environment for the next test.
// self::unsetStore(STORE_TYPO3); if($fileConfigIni=='init'){
// self::fillStoreTypo3($bodytext); $fileConfigIni='';
// }
// self::unsetStore(STORE_CLIENT); // fake to have a clean environment for the next test.
// self::fillStoreClient(); self::unsetStore(STORE_TYPO3);
// } self::fillStoreTypo3($bodytext);
self::unsetStore(STORE_CLIENT);
self::fillStoreClient();
}
// Testing different config files means initialize completely // Testing different config files means initialize completely
if ($fileConfigIni != '') { if ($fileConfigIni != '') {
......
...@@ -1189,4 +1189,13 @@ class DirtyTest extends AbstractDatabaseTest { ...@@ -1189,4 +1189,13 @@ class DirtyTest extends AbstractDatabaseTest {
$this->sip->sipUniqId('badcaffee1234'); $this->sip->sipUniqId('badcaffee1234');
$_COOKIE[SESSION_NAME] = 'SessionCookieAlice'; $_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 { ...@@ -39,7 +39,7 @@ class StoreTest extends TestCase {
$_GET['key04'] = '4567'; $_GET['key04'] = '4567';
$_POST['key04'] = '5678'; $_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