Commit 3db71cad authored by Carsten  Rose's avatar Carsten Rose
Browse files

Added tests for _[pP]age?

ReportTest.php
parent 58809c47
......@@ -1233,8 +1233,8 @@ Special column names
* or by a **one character qualifier** followed by the ':' character, placed in front of the actual parameter value.
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**Reserved column name**| **Purpose** |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Reserved column name | Purpose |
+========================+=============================================================================================================================================================================================+
|_link |Easily create links with different features. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|_mailto |Quickly create email links. A click on the link will open the default mailer. The address is encrypted via JS against email bots. |
......@@ -1269,7 +1269,7 @@ Column: link
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|URL|IMG|Meaning |Qualifier |Example |Description |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
+===+===+==========+===================================+===========================+========================================================================================================================================+
|x | |URL |u:<url> |u:http://www.example.com |If an image is specified, it will be rendered inside the link, default link class: external |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|x | |Mail |m:<email> |m:info@example.com |Default link class: email |
......@@ -1324,7 +1324,7 @@ Render mode
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|Mode |Both: url & text |Only: url |Only: text|Description |
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
+===========+====================+===================+==========+===================================================================+
|0 (default)|<a href=url>text</a>|<a href=url>url</a>| |text or image will be shown, only if there is a url, page or mailto|
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|1 |<a href=url>text</a>|<a href=url>url</a>|text |Text or image will be shown, independet of there is a url |
......@@ -1394,11 +1394,11 @@ Question
If the user click on the negative answer (or waits for timout), the alert is closed and the browser does nothing.
* All parameter are optional.
* Parameter are seperated by ':'
* To use ':' inside the text, the colon has to be escaped by '\'. E.g. 'ok\: I understand'.
* To use ':' inside the text, the colon has to be escaped by '\\'. E.g. 'ok\\: I understand'.
+----------------------+--------------------------------------------------------------------------------------------------------------------------+
| **Parameter** | **Description** |
+=================================================================================================================================================+
| Parameter | Description |
+======================+==========================================================================================================================+
| Text | The text shown by the alert. HTML is allowed to format the text. Any ':' needs to be escaped. Default: 'Please confirm'. |
+----------------------+--------------------------------------------------------------------------------------------------------------------------+
| Level | success, info, warning, danger |
......@@ -1415,7 +1415,7 @@ Question
Examples:
+------------------------------------------------------------+---------------------------------------------------------------------------+
| **SQL-Query** | **Result** |
| SQL-Query | Result |
+============================================================+===========================================================================+
| SELECT "p:form_person|q:Edit Person:warn" AS _link | Shows alert with level 'warn' |
+------------------------------------------------------------+---------------------------------------------------------------------------+
......@@ -1446,8 +1446,8 @@ The colum name is composed of the string *page* and a trailing character to spec
..
+---------------+-----------------------------------------------+-------------------------------------+----------------------------------------------+
|**column name**|**Purpose** |**default value of question parameter**|**Mandatory parameters** |
+---------------+-----------------------------------------------+-------------------------------------+----------------------------------------------+
| column name | Purpose | default value of question parameter | Mandatory parameters |
+===============+===============================================+=====================================+==============================================+
|_page |Internal link without a grafic |empty |p:<pageId>[&param] |
+---------------+-----------------------------------------------+-------------------------------------+----------------------------------------------+
|_pagec |Internal link without a grafic, with question |*Please confirm!* |p:<pageId>[&param] |
......@@ -1471,8 +1471,8 @@ The colum name is composed of the string *page* and a trailing character to spec
* Optional set of dialog boxes.
+-------------+-------------------------------------------------------------------------------------------------+----------------------------------------------------------+---------------------------------------------------------------+
|**Parameter**|**Description** |**Default value** |Example |
+-------------+-------------------------------------------------------------------------------------------------+----------------------------------------------------------+---------------------------------------------------------------+
| Parameter | Description | Default value |Example |
+=============+=================================================================================================+==========================================================+===============================================================+
|<page> |TYPO3 page id or page alias. |The current page: *{{pageId}}* |45 application application&N_param1=1045 |
+-------------+-------------------------------------------------------------------------------------------------+----------------------------------------------------------+---------------------------------------------------------------+
|<text> |Text, wrapped by the link. If there is an icon, text will be displayed to the right of it. |empty string | |
......@@ -1520,7 +1520,7 @@ angle.
+-------------+-------------------------------------------------------------------------------------------------------+-----------------+
|**Parameter**|**Description** |**Default value**|
+-------------+-------------------------------------------------------------------------------------------------------+-----------------+
+=============+=======================================================================================================+=================+
|<text> |The string that should be rendered vertically. |none |
+-------------+-------------------------------------------------------------------------------------------------------+-----------------+
|<angle> |How many degrees should the text be rotated? The angle is measured clockwise from baseline of the text.|*270* |
......@@ -1575,7 +1575,7 @@ Easily create Email links.
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+
|**Parameter** |**Description** |**Default |
| | |value** |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+
+==============+==============================================================================================================================================================================================================+=============+
|<emailaddress>|The email address where the link should point to. |none |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+
|<linktext> |The text that should be displayed on the website and be linked to the email address. This will typically be the name of the recipient. If this parameter is omitted, the email address will be displayed as |none |
......@@ -1623,7 +1623,7 @@ Send simple plain text emails. Every mail will be logged in the mail log. The lo
+------------------------------------------------------------+------------------------------------------------------------------------------------------+------------+
|**Parameter** |**Description** |**Required**|
+------------------------------------------------------------+------------------------------------------------------------------------------------------+------------+
+============================================================+==========================================================================================+============+
|receiver@domain.com[:johndoe],receiver2@domain.com[:janedoe]|Comma-separated list of Email-receiver(s). An optional name can be added using a colon (:)| |
+------------------------------------------------------------+------------------------------------------------------------------------------------------+------------+
|sender@domain.com[:williwutzmann] |Sender of the email. An optional name can be added using a colon (:) | |
......@@ -1679,7 +1679,7 @@ $TYPO3_CONF_VARS[$_EXTKEY]['log']['mail'].
+------------------------------------------------------------+----------------------------------------------------------------------------------------------+------------+
|**Parameter** |**Description** |**required**|
+------------------------------------------------------------+----------------------------------------------------------------------------------------------+------------+
+============================================================+==============================================================================================+============+
|receiver@domain.com[:johndoe],receiver2@domain.com[:janedoe]|Comma-separated list of Email-receiver(s). An optional name can be added using a colon (:) | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------+------------+
|sender@domain.com[:williwutzmann] |Sender of the email. An optional name can be added using a colon (:) | |
......@@ -1719,7 +1719,7 @@ Renders images. Allows to define an alternative text and a title attribute for t
+-------------+-------------------------------------------------------------------------------------------+---------------------------+
|**Parameter**|**Description** |**Default value/behaviour**|
+-------------+-------------------------------------------------------------------------------------------+---------------------------+
+=============+===========================================================================================+===========================+
|<pathtoimage>|The path to the image file. |none |
+-------------+-------------------------------------------------------------------------------------------+---------------------------+
|<alttext> |Alternative text. Will be displayed if image can't be loaded (alt attribute of img tag). |empty string |
......@@ -1775,7 +1775,7 @@ Runs batch files or executables on the webserver. In case of an error, returncod
+-------------+--------------------------------------------------+-----------------+
|**Parameter**|**Description** |**Default value**|
+-------------+--------------------------------------------------+-----------------+
+=============+==================================================+=================+
|<command> |The command that should be executed on the server.|none |
+-------------+--------------------------------------------------+-----------------+
......@@ -1915,7 +1915,7 @@ Solution for *#Challenge_2*:
+-------------+--------------------------------------------------------------------+--------+
|**Parameter**|**Description** |Required|
+-------------+--------------------------------------------------------------------+--------+
+=============+====================================================================+========+
|Q |Any of the *reserved column names* | |
+-------------+--------------------------------------------------------------------+--------+
|Z |Process the column but don't display it | |
......
......@@ -712,6 +712,137 @@ EOF;
}
/**
*
*/
public function testReportPageE() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4' AS _pagee FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Edit" ><span class="glyphicon glyphicon-pencil" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4|t:click me' AS _pagee FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Edit" ><span class="glyphicon glyphicon-pencil" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageFixE() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4' AS _Pagee FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Edit" ><span class="glyphicon glyphicon-pencil" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4|click me' AS _Pagee FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Edit" ><span class="glyphicon glyphicon-pencil" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageH() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4' AS _pageh FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Help" ><span class="glyphicon glyphicon glyphicon-question-sign" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4|t:click me' AS _pageh FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Help" ><span class="glyphicon glyphicon glyphicon-question-sign" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageFixH() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4' AS _Pageh FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Help" ><span class="glyphicon glyphicon glyphicon-question-sign" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4|click me' AS _Pageh FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Help" ><span class="glyphicon glyphicon glyphicon-question-sign" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageI() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4' AS _pagei FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Information" ><span class="glyphicon glyphicon glyphicon-info-sign" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4|t:click me' AS _pagei FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Information" ><span class="glyphicon glyphicon glyphicon-info-sign" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageFixI() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4' AS _Pagei FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Information" ><span class="glyphicon glyphicon glyphicon-info-sign" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4|click me' AS _Pagei FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Information" ><span class="glyphicon glyphicon glyphicon-info-sign" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageN() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4' AS _pagen FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="New" ><span class="glyphicon glyphicon-plus" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4|t:click me' AS _pagen FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="New" ><span class="glyphicon glyphicon-plus" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageFixN() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4' AS _Pagen FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="New" ><span class="glyphicon glyphicon-plus" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4|click me' AS _Pagen FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="New" ><span class="glyphicon glyphicon-plus" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageS() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4' AS _pages FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Details" ><span class="glyphicon glyphicon glyphicon-search" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'p:form&a=1&r=3&type=4|t:click me' AS _pages FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Details" ><span class="glyphicon glyphicon glyphicon-search" ></span> click me</a>', $result);
}
/**
*
*/
public function testReportPageFixS() {
// _paged: incl. alert
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4' AS _Pages FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Details" ><span class="glyphicon glyphicon glyphicon-search" ></span></a>', $result);
$result = $this->report->process("10.sql = SELECT 'form&a=1&r=3&type=4|click me' AS _Pages FROM Person ORDER BY id LIMIT 1");
$this->assertEquals('<a href="index.php?id=form&type=4&s=badcaffee1234" class="btn btn-default" title="Details" ><span class="glyphicon glyphicon glyphicon-search" ></span> click me</a>', $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