Commit 6402f2aa authored by Marc Egger's avatar Marc Egger
Browse files

Refs #12588 fix some tests

parent 4da58073
Pipeline #5412 failed with stages
in 1 minute and 59 seconds
......@@ -62,6 +62,7 @@ class Config {
/**
* Read qfq.json (merge with Typo3-qfq config if exists).
* Note: Deprecated config file typo3conf/config.qfq.php is translated to JSON in PATH:findAppToProject(..)
* Note: Settings in qfq.json overwrite T3 settings
*
* @param string $PhpUnitOverloadAbsoluteConfigFilePath
* @throws \CodeException
......
......@@ -408,7 +408,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
$formElement[FE_SUBRECORD_OPTION] = '';
$result = $build->buildSubrecord($formElement, 'name:1', '', $json);
$this->assertEquals('<table class="table table-hover qfq-subrecord-table qfq-color-grey-2" id="1-123" ><thead><tr><th>id</th><th>name</th><th>firstName</th></tr></thead><tbody ><tr class="record" ><td><span class="text-muted">1</span></td><td>Doe</td><td>John</td></tr><tr class="record" ><td><span class="text-muted">2</span></td><td>Smith</td><td>Jane</td></tr></tbody></table>', $result);
$this->assertEquals('<table class="table table-hover qfq-subrecord-table qfq-color-grey-2" id="123-123" ><thead><tr><th>id</th><th>name</th><th>firstName</th></tr></thead><tbody ><tr class="record" ><td><span class="text-muted">1</span></td><td>Doe</td><td>John</td></tr><tr class="record" ><td><span class="text-muted">2</span></td><td>Smith</td><td>Jane</td></tr></tbody></table>', $result);
// $this->assertEquals('Please save this record first.', $result);
$this->store->setStore(['id' => 1], STORE_RECORD, true);
......
......@@ -113,20 +113,20 @@ class LinkTest extends TestCase {
// 1 Parameter
$expect = $args;
$expect['page'] = '?id=page1';
$expect['page'] = BASE_DIR_FAKE . '/page1';
$result = $link->fillParameter(array(), 'p:page1', $rcTokenGiven);
$this->assertEquals($expect, $result);
// 1 Parameter, 1 Default
$expect = $args;
$expect['page'] = '?id=page1';
$expect['page'] = BASE_DIR_FAKE . '/page1';
$expect['text'] = 'comment';
$result = $link->fillParameter(array(), 'p:page1', $rcTokenGiven, 't:comment');
$this->assertEquals($expect, $result);
// 1 Parameter, 1 Default
$expect = $args;
$expect['page'] = '?id=page1';
$expect['page'] = BASE_DIR_FAKE . '/page1';
$expect['text'] = 'comment';
$expect['sip'] = '1';
$result = $link->fillParameter(array(), 'p:page1|t:comment', $rcTokenGiven, 'p:page1|t:comment|s');
......@@ -209,25 +209,25 @@ class LinkTest extends TestCase {
*/
public function testLinkPageBasic() {
$link = new Link($this->sip, DB_INDEX_DEFAULT, true);
Store::setVar(TYPO3_PAGE_ID, 'firstPage', STORE_TYPO3);
Store::setVar(TYPO3_PAGE_SLUG, '/firstPage', STORE_TYPO3);
$result = $link->renderLink('p');
$this->assertEquals('<a href="?id=firstPage" >?id=firstPage</a>', $result);
$this->assertEquals('<a href="' . BASE_DIR_FAKE . '/firstPage" >' . BASE_DIR_FAKE . '/firstPage</a>', $result);
$result = $link->renderLink('p:');
$this->assertEquals('<a href="?id=firstPage" >?id=firstPage</a>', $result);
$this->assertEquals('<a href="' . BASE_DIR_FAKE . '/firstPage" >' . BASE_DIR_FAKE . '/firstPage</a>', $result);
$result = $link->renderLink('p:secondPage');
$this->assertEquals('<a href="?id=secondPage" >?id=secondPage</a>', $result);
$this->assertEquals('<a href="' . BASE_DIR_FAKE . '/secondPage" >' . BASE_DIR_FAKE . '/secondPage</a>', $result);
$result = $link->renderLink('p:id=secondPage');
$this->assertEquals('<a href="?id=secondPage" >?id=secondPage</a>', $result);
$this->assertEquals('<a href="' . BASE_DIR_FAKE . '/secondPage" >' . BASE_DIR_FAKE . '/secondPage</a>', $result);
$result = $link->renderLink('p:id=secondPage&id=100&t=2&param=hello');
$this->assertEquals('<a href="?id=secondPage&id=100&t=2&param=hello" >?id=secondPage&id=100&t=2&param=hello</a>', $result);
$this->assertEquals('<a href="' . BASE_DIR_FAKE . '/secondPage?id=100&t=2&param=hello" >' . BASE_DIR_FAKE . '/secondPage?id=100&t=2&param=hello</a>', $result);
$result = $link->renderLink('p:secondPage|t:Hello world');
$this->assertEquals('<a href="?id=secondPage" >Hello world</a>', $result);
$this->assertEquals('<a href="' . BASE_DIR_FAKE . '/secondPage" >Hello world</a>', $result);
}
/**
......
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