diff --git a/extension/qfq/tests/phpunit/LinkTest.php b/extension/qfq/tests/phpunit/LinkTest.php index 0382d149ed97b47d7c6236f2e0b702bb7f41c783..e5557518a747da2549cd55723542714824d1d1c3 100644 --- a/extension/qfq/tests/phpunit/LinkTest.php +++ b/extension/qfq/tests/phpunit/LinkTest.php @@ -997,7 +997,6 @@ EOF; } - /** * */ diff --git a/extension/qfq/tests/phpunit/ReportTest.php b/extension/qfq/tests/phpunit/ReportTest.php index bcb0204d8ea309a46561888c4f053febd88c9ca9..4010ed85b3abc68011cfa2939babe37acc19d2ca 100644 --- a/extension/qfq/tests/phpunit/ReportTest.php +++ b/extension/qfq/tests/phpunit/ReportTest.php @@ -8,6 +8,7 @@ require_once(__DIR__ . '/AbstractDatabaseTest.php'); require_once(__DIR__ . '/../../qfq/report/Report.php'); require_once(__DIR__ . '/../../qfq/store/Store.php'); require_once(__DIR__ . '/../../qfq/Evaluate.php'); +require_once(__DIR__ . '/../../qfq/store/Session.php'); /** * Created by PhpStorm. @@ -667,6 +668,10 @@ EOF; $result = $this->report->process("10.sql = SELECT 'U:table=Person&r=123' AS _paged FROM Person ORDER BY id LIMIT 1"); $this->assertEquals('<a href="' . API_DIR . '/' . API_DELETE_PHP . '?s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><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('_modeAnswer=html&_targetUrl=localhost&r=123&table=Person', $result); + // _paged: incl. alert $result = $this->report->process("10.sql = SELECT 'U:form=Person&r=123' AS _paged FROM Person ORDER BY id LIMIT 1"); $this->assertEquals('<a href="' . API_DIR . '/' . API_DELETE_PHP . '?s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span></a>', $result); @@ -705,11 +710,11 @@ alert.show(); return false;" EOF; - // _paged: incl. alert + // _Paged: incl. alert $result = $this->report->process("10.sql = SELECT 'table=Person&r=123' AS _Paged FROM Person ORDER BY id LIMIT 1"); $this->assertEquals('<a href="' . API_DIR . '/' . API_DELETE_PHP . '?s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span></a>', $result); - // _paged: other than defaults for the alert. + // _Paged: other than defaults for the alert. $js = str_replace('Do you really want to delete the record?', 'Move to trash?', $js); $js = str_replace("type: 'info'", "type: 'success'", $js); $js = str_replace('Ok', 'yes', $js); @@ -723,7 +728,6 @@ EOF; $result = $this->report->process("10.sql = SELECT 'table=Person&r=123|click me||Move to trash?:success:yes:no:10:0' AS _Paged FROM Person ORDER BY id LIMIT 1"); $this->assertEquals('<a href="' . API_DIR . '/' . API_DELETE_PHP . '?s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span> click me</a>', $result); - } /** diff --git a/extension/qfq/tests/phpunit/SipTest.php b/extension/qfq/tests/phpunit/SipTest.php index 58c883be76b81076bc31f1a8bbdd8673d8a31191..a12d8e1ca0d614245c91bcb7a3e7a9c8f1e08dc3 100644 --- a/extension/qfq/tests/phpunit/SipTest.php +++ b/extension/qfq/tests/phpunit/SipTest.php @@ -56,6 +56,10 @@ class SipTest extends \PHPUnit_Framework_TestCase { } + /** + * @throws CodeException + * @throws UserFormException + */ public function testGetVarsFromSip() { $sip = new Sip('fakesessionname', true); $sip->sipUniqId('badcaffee1234'); @@ -85,6 +89,9 @@ class SipTest extends \PHPUnit_Framework_TestCase { } + /** + * + */ public function testFakeUniqId() { $sip = new Sip('fakesessionname', true); $this->assertEquals('badcaffee1234', $sip->sipUniqId('badcaffee1234')); @@ -93,6 +100,9 @@ class SipTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('badcaffee5678', $sip->sipUniqId('badcaffee5678')); } + /** + * @throws CodeException + */ public function testGetSipFromUrlParam() { $sip = new Sip('fakesessionname', true); @@ -113,6 +123,9 @@ class SipTest extends \PHPUnit_Framework_TestCase { } + /** + * + */ public function testSipUniqId() { $sip = new Sip('fakesessionname', true); $sip->sipUniqId('badcaffee1234'); @@ -121,6 +134,9 @@ class SipTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('badcaffee1234', $s); } + /** + * @throws CodeException + */ public function testGetQueryStringFromSip() { $sip = new Sip('fakesessionname', true); $sip->sipUniqId('badcaffee1234');