From dcac25a4782e0be6281c2134999adbcbe10d0ed4 Mon Sep 17 00:00:00 2001 From: Carsten Rose <carsten.rose@math.uzh.ch> Date: Sat, 28 Jan 2017 10:34:42 +0100 Subject: [PATCH] ReportTest.php: adjusted test to removed 'p:' parameter --- extension/qfq/tests/phpunit/ReportTest.php | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/extension/qfq/tests/phpunit/ReportTest.php b/extension/qfq/tests/phpunit/ReportTest.php index 4d96ff08a..c84270c37 100644 --- a/extension/qfq/tests/phpunit/ReportTest.php +++ b/extension/qfq/tests/phpunit/ReportTest.php @@ -668,8 +668,8 @@ return false;" EOF; // _paged: incl. alert - $result = $this->report->process("10.sql = SELECT 'p:form' AS _paged FROM Person ORDER BY id LIMIT 1"); - $this->assertEquals('<a href="' . API_DIR . '/' . API_DELETE_PHP . '?id=&s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span></a>', $result); + $result = $this->report->process("10.sql = SELECT 'U:table=Person' 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. $js = str_replace('Do you really want to delete the record?', 'Move to trash?', $js); @@ -679,12 +679,12 @@ EOF; $js = str_replace('timeout: 0', 'timeout: 10000', $js); $js = str_replace('modal: true', 'modal: false', $js); $js = str_replace("type: 'warning'", "type: 'success'", $js); - $result = $this->report->process("10.sql = SELECT 'p:form|q: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 . '?id=&s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span></a>', $result); + $result = $this->report->process("10.sql = SELECT 'U:table=Person|q: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></a>', $result); - $result = $this->report->process("10.sql = SELECT 'p:form|q:Move to trash?:success:yes:no:10:0|t:click me' AS _paged FROM Person ORDER BY id LIMIT 1"); - $this->assertEquals('<a href="' . API_DIR . '/' . API_DELETE_PHP . '?id=&s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span> click me</a>', $result); + $result = $this->report->process("10.sql = SELECT 'U:table=Person|q:Move to trash?:success:yes:no:10:0|t:click me' 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); } @@ -707,8 +707,8 @@ return false;" EOF; // _paged: incl. alert - $result = $this->report->process("10.sql = SELECT 'form' AS _Paged FROM Person ORDER BY id LIMIT 1"); - $this->assertEquals('<a href="' . API_DIR . '/' . API_DELETE_PHP . '?id=&s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span></a>', $result); + $result = $this->report->process("10.sql = SELECT 'table=Person' 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. $js = str_replace('Do you really want to delete the record?', 'Move to trash?', $js); @@ -718,12 +718,12 @@ EOF; $js = str_replace('timeout: 0', 'timeout: 10000', $js); $js = str_replace('modal: true', 'modal: false', $js); $js = str_replace("type: 'warning'", "type: 'success'", $js); - $result = $this->report->process("10.sql = SELECT 'form|||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 . '?id=&s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span></a>', $result); + $result = $this->report->process("10.sql = SELECT 'table=Person|||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></a>', $result); - $result = $this->report->process("10.sql = SELECT 'form|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 . '?id=&s=badcaffee1234" class="btn btn-default" title="Delete" ' . $js . ' ><span class="glyphicon glyphicon-trash" ></span> click me</a>', $result); + $result = $this->report->process("10.sql = SELECT 'table=Person|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); } -- GitLab