Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
2a530c90
Commit
2a530c90
authored
Jan 28, 2017
by
Carsten Rose
Browse files
ReportTest.php: added check for paged / modeAnswer / targetUrl
parent
197ad3cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
extension/qfq/tests/phpunit/LinkTest.php
View file @
2a530c90
...
...
@@ -997,7 +997,6 @@ EOF;
}
/**
*
*/
...
...
extension/qfq/tests/phpunit/ReportTest.php
View file @
2a530c90
...
...
@@ -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;
// _
p
aged: incl. alert
// _
P
aged: 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
);
// _
p
aged: other than defaults for the alert.
// _
P
aged: 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
);
}
/**
...
...
extension/qfq/tests/phpunit/SipTest.php
View file @
2a530c90
...
...
@@ -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'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment