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

phpunit: fix problems.

parent 1713abf3
Pipeline #1216 passed with stage
in 1 minute and 38 seconds
......@@ -195,6 +195,10 @@ class FormActionTest extends AbstractDatabaseTest {
$this->store->setVar('city', '', STORE_FORM, true);
$feSpecAction[FE_REQUIRED_LIST] = 'street,city,downtown';
$formAction->elements(0, [$feSpecAction], FE_TYPE_BEFORE_LOAD . ',' . FE_TYPE_AFTER_LOAD . ',' . FE_TYPE_AFTER_UPDATE . ',' . FE_TYPE_BEFORE_SAVE);
# Fake to suppress phpUnit about missing test.
$this->assertEquals('', '');
}
/**
......@@ -245,6 +249,9 @@ class FormActionTest extends AbstractDatabaseTest {
$feSpecAction[FE_SQL_VALIDATE] = '{{!SELECT id FROM Person LIMIT 2}}';
$feSpecAction[FE_EXPECT_RECORDS] = '2';
$formAction->elements(0, [$feSpecAction, $feSpecAction], FE_TYPE_BEFORE_LOAD . ',' . FE_TYPE_AFTER_LOAD . ',' . FE_TYPE_AFTER_UPDATE . ',' . FE_TYPE_BEFORE_SAVE);
# Fake to suppress phpUnit about missing test.
$this->assertEquals('', '');
}
/**
......
......@@ -35,6 +35,9 @@ class SupportTest extends TestCase {
unset($_GET);
$this->store->setVar(TYPO3_PAGE_ID, 1, STORE_TYPO3, true);
$this->store->setVar(TYPO3_PAGE_TYPE, 2, STORE_TYPO3, true);
$this->store->setVar(TYPO3_PAGE_LANGUAGE, 3, STORE_TYPO3, true);
$queryArray = array();
Support::appendTypo3ParameterToArray($queryArray);
$this->assertEquals(['id' => 1, 'type' => 2, 'L' => 3], $queryArray);
......
......@@ -1253,28 +1253,28 @@ EOF;
// Report Delete action, default: 'Report', no Icon
$result = $link->renderLink('U:form=Person&r=123|x');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/delete.php?s=badcaffee1234" >typo3conf/ext/qfq/qfq/api/delete.php?s=badcaffee1234</a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/delete.php?s=badcaffee1234" >typo3conf/ext/qfq/Source/api/delete.php?s=badcaffee1234</a>', $result);
// Check das via '_paged' SIP_MODE_ANSWER and SIP_TARGET_URL has been set.
$result = \qfq\Session::get('badcaffee1234');
$this->assertEquals('__dbIndexData=1&_modeAnswer=html&_targetUrl=localhost&form=Person&r=123', $result);
// Report Delete action, explicit 'Report', no Icon
$result = $link->renderLink('U:form=PersonA&r=1234|x:r');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/delete.php?s=badcaffee1234" >typo3conf/ext/qfq/qfq/api/delete.php?s=badcaffee1234</a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/delete.php?s=badcaffee1234" >typo3conf/ext/qfq/Source/api/delete.php?s=badcaffee1234</a>', $result);
// Check das via '_paged' SIP_MODE_ANSWER and SIP_TARGET_URL has been set.
$result = \qfq\Session::get('badcaffee1234');
$this->assertEquals('__dbIndexData=1&_modeAnswer=html&_targetUrl=localhost&form=PersonA&r=1234', $result);
// Report Delete action, explicit 'Report', Text
$result = $link->renderLink('U:form=PersonAa&r=2234|x:r|t:Delete Record');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/delete.php?s=badcaffee1234" >Delete Record</a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/delete.php?s=badcaffee1234" >Delete Record</a>', $result);
// Check das via '_paged' SIP_MODE_ANSWER and SIP_TARGET_URL has been set.
$result = \qfq\Session::get('badcaffee1234');
$this->assertEquals('__dbIndexData=1&_modeAnswer=html&_targetUrl=localhost&form=PersonAa&r=2234', $result);
// Report Delete action, with Icon
$result = $link->renderLink('U:form=PersonB&r=1235|x|D');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/delete.php?s=badcaffee1234" class="btn btn-default" title="Delete" ><span class="glyphicon glyphicon-trash" ></span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/delete.php?s=badcaffee1234" class="btn btn-default" title="Delete" ><span class="glyphicon glyphicon-trash" ></span></a>', $result);
// Check das via '_paged' SIP_MODE_ANSWER and SIP_TARGET_URL has been set.
$result = \qfq\Session::get('badcaffee1234');
$this->assertEquals('__dbIndexData=1&_modeAnswer=html&_targetUrl=localhost&form=PersonB&r=1235', $result);
......@@ -1364,27 +1364,27 @@ EOF;
// Single file
$result = $link->renderLink('d|F:file.pdf');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
// With download filename
$result = $link->renderLink('d:download.pdf|F:file.pdf');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=download.pdf&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: download.pdf" data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/download.php?mode=pdf&_exportFilename=download.pdf&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: download.pdf" data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
// Two files
$result = $link->renderLink('d|F:file.pdf|F:file2.pdf');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZnxGOmZpbGUyLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZnxGOmZpbGUyLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
// Mode: PDF
$result = $link->renderLink('d|F:file.pdf|M:pdf');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
// Download with Tooltip
$result = $link->renderLink('d|F:file.pdf|o:Tooltip');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Tooltip" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Tooltip" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span></span></a>', $result);
// Download & Button Text
$result = $link->renderLink('d|F:file.pdf|t:Button text');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span> Button text</span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" title="Download" ><span class="btn btn-default" data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));"><span class="glyphicon glyphicon-file" ></span> Button text</span></a>', $result);
// Download, r:3
$result = $link->renderLink('d|F:file.pdf|r:3');
......@@ -1397,7 +1397,7 @@ EOF;
// Single file
$result = $link->renderLink('d|F:file.pdf|t:DL|b:0');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" ><span data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));">DL</span></a>', $result);
$this->assertEquals('<a href="typo3conf/ext/qfq/Source/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" ><span data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));">DL</span></a>', $result);
// Single file
$result = $link->renderLink('d|F:file.pdf|t:DL|b:0|r:3');
......
......@@ -102,6 +102,8 @@ class ReportTest extends AbstractDatabaseTest {
}
/**
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......@@ -875,6 +877,8 @@ EOF;
/**
* Missing r, missing form or table
*
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......@@ -891,6 +895,8 @@ EOF;
/**
* Missing r, given table
*
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......@@ -907,6 +913,8 @@ EOF;
/**
* Missing r, given form
*
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......@@ -923,6 +931,8 @@ EOF;
/**
* missing form, missing table
*
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......@@ -937,7 +947,10 @@ EOF;
}
/**
* missng r, given table
* missing r, given table
*
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......@@ -952,6 +965,8 @@ EOF;
}
/**
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......@@ -966,6 +981,8 @@ EOF;
}
/**
* @expectedException \qfq\UserReportException
*
* @throws CodeException
* @throws DbException
* @throws DownloadException
......
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