Commit 8e65337b authored by Marc Egger's avatar Marc Egger
Browse files

Refs #12159 fix unit tests

parent 50eb6102
Pipeline #5206 failed with stages
in 2 minutes and 2 seconds
...@@ -478,7 +478,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest { ...@@ -478,7 +478,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
// _id: 1, icon: bullet-green.gif // _id: 1, icon: bullet-green.gif
$formElement['sql1'] = $this->dbArray[DB_INDEX_DEFAULT]->sql('SELECT id AS "_id", "bullet-green.gif" AS "Status|icon" FROM Person ORDER BY id LIMIT 2'); $formElement['sql1'] = $this->dbArray[DB_INDEX_DEFAULT]->sql('SELECT id AS "_id", "bullet-green.gif" AS "Status|icon" FROM Person ORDER BY id LIMIT 2');
$result = $build->buildSubrecord($formElement, 'name:1', '', $json); $result = $build->buildSubrecord($formElement, 'name:1', '', $json);
$this->assertEquals('<table class="' . SUBRECORD_TABLE_CLASS_DEFAULT . '" id="1-123" ><thead><tr><th>Status</th></tr></thead><tbody ><tr class="record" ><td><image src=\'typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif\'></td></tr><tr class="record" ><td><image src=\'typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif\'></td></tr></tbody></table>', $result); $this->assertEquals('<table class="' . SUBRECORD_TABLE_CLASS_DEFAULT . '" id="1-123" ><thead><tr><th>Status</th></tr></thead><tbody ><tr class="record" ><td><image src=\'http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif\'></td></tr><tr class="record" ><td><image src=\'http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif\'></td></tr></tbody></table>', $result);
// _id: 1, mailto: john@doe.com // _id: 1, mailto: john@doe.com
$formElement['sql1'] = $this->dbArray[DB_INDEX_DEFAULT]->sql('SELECT id AS "_id", "john@doe.com" AS "EMail|mailto" FROM Person ORDER BY id LIMIT 2'); $formElement['sql1'] = $this->dbArray[DB_INDEX_DEFAULT]->sql('SELECT id AS "_id", "john@doe.com" AS "EMail|mailto" FROM Person ORDER BY id LIMIT 2');
......
...@@ -181,15 +181,15 @@ class ReportTest extends AbstractDatabaseTest { ...@@ -181,15 +181,15 @@ class ReportTest extends AbstractDatabaseTest {
// link, checked // link, checked
$result = $this->report->process("10.sql = SELECT 'u:http://www.example.com|C' AS _link FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'u:http://www.example.com|C' AS _link FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="http://www.example.com" ><img alt="Checked green" src="typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" ></a>', $result); $this->assertEquals('<a href="http://www.example.com" ><img alt="Checked green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" ></a>', $result);
// linck, checked, text // linck, checked, text
$result = $this->report->process("10.sql = SELECT 'u:http://www.example.com|C|t:Hello World' AS _link FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'u:http://www.example.com|C|t:Hello World' AS _link FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="http://www.example.com" ><img alt="Checked green" src="typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" > Hello World</a>', $result); $this->assertEquals('<a href="http://www.example.com" ><img alt="Checked green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" > Hello World</a>', $result);
// link, checked, text, tooltip // link, checked, text, tooltip
$result = $this->report->process("10.sql = SELECT 'u:http://www.example.com|C|t:Hello World|o:more information' AS _link FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'u:http://www.example.com|C|t:Hello World|o:more information' AS _link FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="http://www.example.com" title="more information" ><img alt="Checked green" src="typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="more information" > Hello World</a>', $result); $this->assertEquals('<a href="http://www.example.com" title="more information" ><img alt="Checked green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="more information" > Hello World</a>', $result);
} }
/** /**
...@@ -418,17 +418,17 @@ EOF; ...@@ -418,17 +418,17 @@ EOF;
// page & bullet (green) // page & bullet (green)
$result = $this->report->process("10.sql = SELECT 'p:form|B' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|B' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Bullet green" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" ></a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Bullet green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" ></a>', $result);
// page & bullet (green) // page & bullet (green)
$result = $this->report->process("10.sql = SELECT 'p:form|B||t:Person' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|B||t:Person' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Bullet green" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Bullet green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result);
$arr = ['blue', 'gray', 'green', 'pink', 'red', 'yellow', 'fake']; $arr = ['blue', 'gray', 'green', 'pink', 'red', 'yellow', 'fake'];
foreach ($arr as $color) { foreach ($arr as $color) {
// page & bullet $color // page & bullet $color
$result = $this->report->process("10.sql = SELECT 'p:form|B:$color' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|B:$color' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals("<a href=\"index.php?id=form&s=badcaffee1234\" ><img alt=\"Bullet $color\" src=\"typo3conf/ext/qfq/Resources/Public/icons/bullet-$color.gif\" title=\"$color\" ></a>", $result); $this->assertEquals("<a href=\"index.php?id=form&s=badcaffee1234\" ><img alt=\"Bullet $color\" src=\"http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-$color.gif\" title=\"$color\" ></a>", $result);
} }
} }
...@@ -449,17 +449,17 @@ EOF; ...@@ -449,17 +449,17 @@ EOF;
// page & bullet (green) // page & bullet (green)
$result = $this->report->process("10.sql = SELECT 'p:form|C' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|C' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Checked green" src="typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" ></a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Checked green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" ></a>', $result);
// page & bullet (green) // page & bullet (green)
$result = $this->report->process("10.sql = SELECT 'p:form|C|t:Person' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|C|t:Person' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Checked green" src="typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" > Person</a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Checked green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" > Person</a>', $result);
$arr = ['blue', 'gray', 'green', 'pink', 'red', 'yellow', 'fake']; $arr = ['blue', 'gray', 'green', 'pink', 'red', 'yellow', 'fake'];
foreach ($arr as $color) { foreach ($arr as $color) {
// page & bullet $color // page & bullet $color
$result = $this->report->process("10.sql = SELECT 'p:form|C:$color' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|C:$color' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals("<a href=\"index.php?id=form&s=badcaffee1234\" ><img alt=\"Checked $color\" src=\"typo3conf/ext/qfq/Resources/Public/icons/checked-$color.gif\" title=\"$color\" ></a>", $result); $this->assertEquals("<a href=\"index.php?id=form&s=badcaffee1234\" ><img alt=\"Checked $color\" src=\"http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/checked-$color.gif\" title=\"$color\" ></a>", $result);
} }
} }
...@@ -540,15 +540,15 @@ EOF; ...@@ -540,15 +540,15 @@ EOF;
// page & AltText - image // page & AltText - image
$result = $this->report->process("10.sql = SELECT 'p:form|t:Person|B|a' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|t:Person|B|a' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result);
// page & AltText - image // page & AltText - image
$result = $this->report->process("10.sql = SELECT 'p:form|t:Person|B|a:' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|t:Person|B|a:' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result);
// page & AltText - image // page & AltText - image
$result = $this->report->process("10.sql = SELECT 'p:form|t:Person|B|a:Hello World' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|t:Person|B|a:Hello World' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Hello World" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" ><img alt="Hello World" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" > Person</a>', $result);
} }
/** /**
...@@ -704,7 +704,7 @@ EOF; ...@@ -704,7 +704,7 @@ EOF;
// page & target (empty) // page & target (empty)
$result = $this->report->process("10.sql = SELECT 'p:form|t:Person|R|B' AS _page FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT 'p:form|t:Person|R|B' AS _page FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" >Person <img alt="Bullet green" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" ></a>', $result); $this->assertEquals('<a href="index.php?id=form&s=badcaffee1234" >Person <img alt="Bullet green" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" ></a>', $result);
} }
...@@ -1345,7 +1345,7 @@ EOF; ...@@ -1345,7 +1345,7 @@ EOF;
foreach ($arr as $color) { foreach ($arr as $color) {
// bullet $color // bullet $color
$result = $this->report->process("10.sql = SELECT '$color' AS _bullet FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT '$color' AS _bullet FROM Person ORDER BY id LIMIT 1");
$this->assertEquals("<img alt=\"Bullet $color\" src=\"typo3conf/ext/qfq/Resources/Public/icons/bullet-$color.gif\" title=\"$color\" >", $result); $this->assertEquals("<img alt=\"Bullet $color\" src=\"http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/bullet-$color.gif\" title=\"$color\" >", $result);
} }
} }
...@@ -1368,7 +1368,7 @@ EOF; ...@@ -1368,7 +1368,7 @@ EOF;
foreach ($arr as $color) { foreach ($arr as $color) {
// check $color // check $color
$result = $this->report->process("10.sql = SELECT '$color' AS _check FROM Person ORDER BY id LIMIT 1"); $result = $this->report->process("10.sql = SELECT '$color' AS _check FROM Person ORDER BY id LIMIT 1");
$this->assertEquals("<img alt=\"Checked $color\" src=\"typo3conf/ext/qfq/Resources/Public/icons/checked-$color.gif\" title=\"$color\" >", $result); $this->assertEquals("<img alt=\"Checked $color\" src=\"http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/typo3conf/ext/qfq/Resources/Public/icons/checked-$color.gif\" title=\"$color\" >", $result);
} }
} }
......
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