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

Support.php: rewrote appendTypo3ParameterToArray() to use Typo3 Store instead...

Support.php: rewrote appendTypo3ParameterToArray() to use Typo3 Store instead of _GET Parameter. Moved randomAlphaNum() to Support.
Link.php: rewrote handling of ToolTip. Renamed doHtmlUrl() to doAnchor().
Utils.php: moved randomAlphaNum() to Support.
Store.php: rewrote fillStoreClient() to be more compatible with phpUnit-test environment. Removed randomAlphaNum() - duplicate in Support.
AnbstractBuildForm.php: rewrote deriveNewRecordUrlFromExistingSip() to use generic Support::appendTypo3ParameterToArray()
Coding.md: Notes for debuggging.
parent a7a89822
......@@ -80,21 +80,26 @@ Debug / Log / Errormessages
* Before firing a SQL or doing processing of an FormElement, set some debugging / error variables:
[src] $this->store->setVar(SYSTEM_SQL_RAW, STORE_SYSTEM)
[src] $this->store->setVar(SYSTEM_SQL_RAW, STORE_SYSTEM)
* Available fields:
<code>
SYSTEM_SQL_RAW
SYSTEM_SQL_FINAL
SYSTEM_SQL_COUNT
SYSTEM_SQL_PARAM_ARRAY
SYSTEM_FORM = CLIENT_FORM; // '<formName> / <formId>'
SYSTEM_FORM_ELEMENT = 'formElement'; // '<formElementName> / <formElementeId>'
SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
</code>
<code>
SYSTEM_SQL_RAW
SYSTEM_SQL_FINAL
SYSTEM_SQL_COUNT
SYSTEM_SQL_PARAM_ARRAY
SYSTEM_FORM = CLIENT_FORM; // '<formName> / <formId>'
SYSTEM_FORM_ELEMENT = 'formElement'; // '<formElementName> / <formElementeId>'
SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
</code>
* Form.debugShowInfo: yes|no will display a tooltip near beside every formelement and show parse/evaluate as tooltip.
* Check to display debug info:
$this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes'
Stores
======
......
......@@ -380,16 +380,18 @@ abstract class AbstractBuildForm {
public function deriveNewRecordUrlFromExistingSip(&$toolTipNew) {
$urlParam = $this->store->getStore(STORE_SIP);
$urlParam[SIP_RECORD_ID] = 0;
unset($urlParam[SIP_SIP]);
unset($urlParam[SIP_URLPARAM]);
$urlParam['id'] = $this->store->getVar(TYPO3_PAGE_ID, STORE_TYPO3);
$urlParam['type'] = $this->store->getVar(TYPO3_PAGE_TYPE, STORE_TYPO3);
Support::appendTypo3ParameterToArray($urlParam);
$sip = $this->store->getSipInstance();
$url = $sip->queryStringToSip(OnArray::toString($urlParam));
if ($this->showDebugInfo) {
//TODO: missing decoding of SIP
$toolTipNew .= PHP_EOL . PHP_EOL . OnArray::toString($urlParam, ' = ', PHP_EOL, "'");
}
......
......@@ -328,3 +328,6 @@ const GLYPH_ICON_SHOW = 'glyphicon glyphicon-search';
const GLYPH_ICON_TOOL = 'glyphicon-wrench';
const GLYPH_ICON_CHECK = 'glyphicon glyphicon-ok';
// SUPPORT
const PARAM_T3_ALL = 't3 all';
const PARAM_T3_NO_ID = "t3 no id";
\ No newline at end of file
......@@ -14,19 +14,29 @@ class Support {
/**
* @param array $queryArray Empty or prefilled assoc array with url parameter
* @param string $mode PARAM_T3_NO_ID, PARAM_T3_ALL
*/
public static function appendTypo3ParameterToArray(array &$queryArray) {
public static function appendTypo3ParameterToArray(array &$queryArray, $mode = PARAM_T3_ALL) {
// if (isset($_GET['id']))
// $queryArray['id'] = self::getCurrentPage();
if (isset($GLOBALS["TSFE"]->id))
$queryArray['id'] = $GLOBALS["TSFE"]->id;
if (isset($_GET['L']))
$queryArray['L'] = $_GET['L'];
$store = Store::getInstance();
if (isset($_GET['type']))
$queryArray['type'] = $_GET['type'];
if ($mode === PARAM_T3_ALL) {
$queryArray['id'] = $store->getVar(TYPO3_PAGE_ID, STORE_TYPO3);
}
// TYPE
$tmp = $store->getVar(TYPO3_PAGE_TYPE, STORE_TYPO3);
if ($tmp !== false && $tmp != 0) {
$queryArray['type'] = $tmp;
}
// Language
$tmp = $store->getVar(TYPO3_PAGE_LANGUAGE, STORE_TYPO3);
if ($tmp !== false && $tmp != 0) {
$queryArray['L'] = $tmp;
}
}
/**
......@@ -213,5 +223,19 @@ class Support {
return $text;
}
/**
* @param int $length Length of the required hash string
* @return string A random alphanumeric hash
*/
public static function randomAlphaNum($length) {
$possible_characters = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$string = "";
while (strlen($string) < $length) {
$string .= substr($possible_characters, rand() % (strlen($possible_characters)), 1);
}
return ($string);
}
}
\ No newline at end of file
......@@ -70,6 +70,7 @@ const NAME_PAGE = 'page';
const NAME_TEXT = 'text';
const NAME_ALT_TEXT = 'altText';
const NAME_TOOL_TIP = 'toolTip';
const NAME_TOOL_TIP_JS = 'toolTipJs';
const NAME_IMAGE = 'image';
const NAME_IMAGE_TITLE = 'imageTitle';
const NAME_GLYPH = 'glyph';
......@@ -125,6 +126,7 @@ class Link {
'u' => 'buildUrl',
'm' => 'buildMail',
'p' => 'buildPage',
'o' => 'buildToolTip',
'P' => 'buildPicture',
'B' => 'buildBullet',
'C' => 'buildCheck',
......@@ -272,7 +274,7 @@ class Link {
$this->doCssClass($vars);
$htmlUrl = $this->doHtmlUrl($vars);
$htmlUrl = $this->doAnchor($vars);
$htmlImage = $this->doHtmlImageGlyph($vars);
// Compose Image & Text
......@@ -283,8 +285,8 @@ class Link {
// ToolTip
$extraSpan = ['', ''];
if ($vars[NAME_TOOL_TIP]) {
$extraSpan[0] = "<span " . $vars[NAME_TOOL_TIP][0] . ">" . $vars[NAME_TOOL_TIP][1];
if ($vars[NAME_TOOL_TIP] !== '') {
$extraSpan[0] = "<span " . $vars[NAME_TOOL_TIP_JS][0] . ">" . $vars[NAME_TOOL_TIP_JS][1];
$extraSpan[1] = "</span>";
}
......@@ -339,7 +341,7 @@ class Link {
// 3: <a href=url>url</a>
case '3':
$link = $htmlUrl . $vars[NAME_URL] . '</a>' . $vars[NAME_TOOL_TIP][1];
$link = $htmlUrl . $vars[NAME_URL] . '</a>' . $vars[NAME_TOOL_TIP_JS][1];
break;
case '13':
$vars[NAME_TEXT] = $vars[NAME_MAIL];
......@@ -348,7 +350,7 @@ class Link {
// 4: <a href=url>Text</a>
case '4':
$link = $htmlUrl . $vars[NAME_TEXT] . '</a>' . $vars[NAME_TOOL_TIP][1];
$link = $htmlUrl . $vars[NAME_TEXT] . '</a>' . $vars[NAME_TOOL_TIP_JS][1];
break;
case '14':
$link = $this->encryptMailtoJS($vars, TRUE);
......@@ -387,7 +389,8 @@ class Link {
$vars[NAME_GLYPH_TITLE] = '';
$vars[NAME_QUESTION] = '';
$vars[NAME_TARGET] = '';
$vars[NAME_TOOL_TIP] = ['', ''];
$vars[NAME_TOOL_TIP] = '';
$vars[NAME_TOOL_TIP_JS] = ['', ''];
$vars[NAME_URL_PARAM] = '';
$vars[NAME_RENDER] = '';
......@@ -428,7 +431,7 @@ class Link {
$keyName = $this->tableVarName[$key];
// A few keys do not have necessarily a value: fake the definition by manual assigning the default
// A few keys do not have necessarily a value: fake the definition by manual creating a value.
if ($value == '') {
switch ($key) {
case 'R':
......@@ -445,12 +448,12 @@ class Link {
}
}
// Take defaults
// Defaults
if ($value === '' && isset($this->varsDefault[$keyName])) {
$value = $this->varsDefault[$keyName];
}
// Check for empty values. Some keys are allowed to be empty.
// Check for empty values. Respect: some keys are allowed to be empty.
if ($value === '' && strpos('uENDHIS', $key) === false) {
throw new UserReportException ("Missing value for '$key'", ERROR_MISSING_VALUE);
}
......@@ -502,26 +505,30 @@ class Link {
}
/**
* Builds complete HTML anchor.
* - <a href="mailto:info@example.com:>info@example.com</a>
* - <a href="http://example.com:>http://example.com</a>
* - If $this->modeHash is set, create a
* Create the HTML anchor.
* - <a href="mailto:info@example.com" title=".." class="..">
* - <a href="http://example.com" title=".." class="..">
* - If $this->modeHash is set, create a hash (sip)
*
* @param array $vars
* @return string
* @throws UserReportException
*/
private function doHtmlUrl(array &$vars) {
$tags = '';
private function doAnchor(array &$vars) {
$attributes = '';
// build URL
$htmlUrl = "";
$anchorTitle = '';
// Link: URL
if ($vars[NAME_URL] !== '') {
if ($vars[NAME_HASH] === "1") {
$vars[NAME_URL] = $this->sip->queryStringToSip($vars[NAME_PAGE] . '&' . $vars[NAME_URL_PARAM]);
if ($this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes') {
}
} else {
......@@ -534,9 +541,10 @@ class Link {
}
}
// If there is no encryption: handle the mailto as an ordinary URL
// Link: MAILTO
if ($vars[NAME_MAIL] !== '') {
// If there is no encryption: handle the mailto as an ordinary URL
if ($vars[NAME_ENCRYPTION] === '0') {
$vars[NAME_URL] = "mailto:" . $vars[NAME_MAIL];
$vars[NAME_MAIL] = "";
......@@ -553,15 +561,16 @@ class Link {
}
}
$tags .= Support::doAttribute('href', $vars[NAME_URL]);
$tags .= Support::doAttribute('class', $vars[NAME_LINK_CLASS]);
$tags .= Support::doAttribute('target', $vars[NAME_TARGET]);
$tags .= Support::doAttribute('title', $anchorTitle);
$attributes .= Support::doAttribute('href', $vars[NAME_URL]);
$attributes .= Support::doAttribute('class', $vars[NAME_LINK_CLASS]);
$attributes .= Support::doAttribute('target', $vars[NAME_TARGET]);
$attributes .= Support::doAttribute('title', $anchorTitle);
if ($vars[NAME_QUESTION]) {
$tags .= Support::doAttribute('onclick', 'confirm(\'' . $vars[NAME_QUESTION] . '\')');
$attributes .= Support::doAttribute('onclick', 'confirm(\'' . $vars[NAME_QUESTION] . '\')');
}
$htmlUrl = '<a ' . $tags . $vars[NAME_TOOL_TIP][0] . '>';
$htmlUrl = '<a ' . $attributes . $vars[NAME_TOOL_TIP_JS][0] . '>';
return ($htmlUrl);
}
......@@ -635,7 +644,7 @@ class Link {
// Compose $dw (documentwrite statement)
$dw .= ' + mm' . $ii++;
}
$dw .= ' + "' . $vars[NAME_LINK_CLASS] . str_replace('"', '\\"', $vars[NAME_TOOL_TIP][0]) . '>"';
$dw .= ' + "' . $vars[NAME_LINK_CLASS] . str_replace('"', '\\"', $vars[NAME_TOOL_TIP_JS][0]) . '>"';
$closeDw = '"</a>")';
} else {
$dw = 'document.write(';
......@@ -655,7 +664,7 @@ class Link {
}
$tt .= '//--></script>';
if ($href) $tt .= $vars[NAME_TOOL_TIP][1];
if ($href) $tt .= $vars[NAME_TOOL_TIP_JS][1];
return ($tt);
}
......@@ -871,4 +880,34 @@ class Link {
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
/**
* Create a ToolTip: $toolTip[0] and $toolTip[1] have to inserted in HTML code accordingly.
* $vars[NAME_TOOL_TIP_JS][0]: JS to show '$toolTip[1]'.
* $vars[NAME_TOOL_TIP_JS][1]: '<span>...</span>' with the tooltip text.
*
* @param $vars
* @param $key
* @param $value
*/
private function buildToolTip(&$vars, $key, $value) {
static $count = 0;
$toolTipIndex = 'tooltip.' . $GLOBALS["TSFE"]->currentRecord . '.' . ++$count;
$vars[NAME_TOOL_TIP_JS] = array();
// Expample: <img src="fileadmin/icons/bullet-gray.gif" onmouseover="document.getElementById('gm167979').style.
// display='block';" onmouseout="document.getElementById('gm167979').style.display='none';" />
$vars[NAME_TOOL_TIP_JS][0] = " onmouseover=\"document.getElementById('" . $toolTipIndex .
"').style.display='block';\" onmouseout=\"document.getElementById('" . $toolTipIndex . "').style.display='none';\"";
// Example: <span id="gm167979" style="display:none; position:absolute; border:solid 1px black; background-color:#F9F3D0;
// padding:3px;">My pesonal tooltip</span>
$vars[NAME_TOOL_TIP_JS][1] = '<span id="' . $toolTipIndex .
'" style="display:none; position:absolute; border:solid 1px black; background-color:#F9F3D0; padding:3px;">' .
$value . '</span>';
return;
}
}
\ No newline at end of file
......@@ -111,14 +111,14 @@ class Utils {
/**
* Create a unique directory in $path
*
* @param string $path path
* @return string path/uniqedir
* @throws codeException
* @param $path
* @return string
* @throws CodeReportException
*/
function createUniqueDir($path) {
// Try max. 20 times
for ($i = 0; $i < 20; $i++) {
$dirname = $this->randomAlphaNum(5);
$dirname = Support::randomAlphaNum(5);
$dirpath = $path . "/" . $dirname;
if (!file_exists($dirpath)) {
......@@ -129,41 +129,4 @@ class Utils {
// Too many tries without success
throw new CodeReportException ("Could not create unique directory.", __FILE__, __LINE__);
}
/**
* @param int $length Length of the required hash string
* @return string A random alphanumeric hash
*/
private function randomAlphaNum($length) {
$possible_characters = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$string = "";
while (strlen($string) < $length) {
$string .= substr($possible_characters, rand() % (strlen($possible_characters)), 1);
}
return ($string);
} // eo createUniqueDir
/**
* Create a ToolTip: $toolTip[0] and $toolTip[1] have to inserted in HTML code accordingly.
*
* @param string $note Text to be shown in the tooltip
* @return array $toolTip $toolTip[0]: JS to show '$toolTip[1]'.
* $toolTip[1]: '<span>...</span>' with the tooltip text.
*/
public function createToolTip($note) {
static $count = 0;
$toolTipIndex = 'tooltip.' . $GLOBALS["TSFE"]->currentRecord . '.' . ++$count;
$toolTip = array();
// Expample: <img src="fileadmin/icons/bullet-gray.gif" onmouseover="document.getElementById('gm167979').style.display='block';" onmouseout="document.getElementById('gm167979').style.display='none';" />
$toolTip[0] = " onmouseover=\"document.getElementById('" . $toolTipIndex . "').style.display='block';\" onmouseout=\"document.getElementById('" . $toolTipIndex . "').style.display='none';\"";
// Example: <span id="gm167979" style="display:none; position:absolute; border:solid 1px black; background-color:#F9F3D0; padding:3px;">My pesonal tooltip</span>
$toolTip[1] = '<span id="' . $toolTipIndex . '" style="display:none; position:absolute; border:solid 1px black; background-color:#F9F3D0; padding:3px;">' . $note . '</span>';
return ($toolTip);
} // createToolTip()
}
......@@ -257,7 +257,15 @@ class Store {
*/
private function fillStoreClient() {
// copy GET and POST and SERVER Parameter. Priority: SERVER, POST, GET
$arr = array_merge($_GET, $_POST, $_SERVER);
$arr = array();
if (isset($_GET))
$arr = array_merge($arr, $_GET);
if (isset($_POST))
$arr = array_merge($arr, $_POST);
if (isset($_SERVER))
$arr = array_merge($arr, $_SERVER);
self::setVarArray($arr, STORE_CLIENT, true);
}
......@@ -321,7 +329,7 @@ class Store {
return '';
case STORE_VAR:
if ($key === VAR_RANDOM) {
return self::randomAlphaNum(RANDOM_LENGTH);
return Support::randomAlphaNum(RANDOM_LENGTH);
} else {
continue 2; // no value provided, continue with while loop
}
......@@ -347,22 +355,6 @@ class Store {
return false;
}
/**
* Creates a random string, with lenght of $length
*
* @param $length
* @return string
*/
private static function randomAlphaNum($length) {
//srand(date("s")); seit PHP 4.2.0 nicht mehr noetig und war auch falsch falls mehrere Aufrufe in gleicher Sekunde
$possible_charactors = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$string = "";
while (strlen($string) < $length) {
$string .= substr($possible_charactors, rand() % (strlen($possible_charactors)), 1);
}
return ($string);
}
/**
* @param string $bodytext
* @param bool|false $phpUnit
......@@ -395,9 +387,10 @@ class Store {
return self::$instance;
}
/**
* @param $store
* @throws UserFormException
* @throws \qfq\CodeException
*/
public static function unsetStore($store) {
// Check valid Storename
......@@ -451,6 +444,7 @@ class Store {
* @param $store
* @param bool|true $overWrite
* @throws UserFormException
* @throws \qfq\CodeException
*/
public static function setVar($key, $value, $store, $overWrite = true) {
// Check valid Storename
......@@ -469,7 +463,9 @@ class Store {
/**
* @param $store
* @return mixed
* @return array
* @throws UserFormException
* @throws \qfq\CodeException
*/
public static function getStore($store) {
// Check valid Storename
......
......@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `Form` (
`permitNew` ENUM('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL DEFAULT 'sip',
`permitEdit` ENUM('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL DEFAULT 'sip',
`render` ENUM('plain', 'table', 'bootstrap') NOT NULL DEFAULT 'plain',
`showButton` SET('new', 'delete', 'close', 'save') NOT NULL DEFAULT 'new,delete,close,save',
`showButton` SET('new', 'delete', 'close', 'save') NOT NULL DEFAULT 'new,delete,close,save',
`multiMode` ENUM('none', 'horizontal', 'vertical') NOT NULL DEFAULT 'none',
`multiSql` TEXT NOT NULL,
`multiDetailForm` VARCHAR(255) NOT NULL DEFAULT '',
......
......@@ -25,7 +25,6 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
*/
private $store = null;
/**
* @throws SyntaxReportException
*/
......@@ -152,7 +151,8 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('<a href="http://example.com" class="external" >http://example.com</a>', $result);
$result = $link->renderLink('t:Example|r:1');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:1');
$this->assertEquals('<a href="http://example.com" class="external" >Example</a>', $result);
......@@ -175,26 +175,32 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|r:3');
$this->assertEquals('<span >http://example.com</span>', $result);
// $this->assertEquals('<span >http://example.com</span>', $result);
$this->assertEquals('http://example.com', $result);
$result = $link->renderLink('t:Example|r:3');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:3');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
// r: 4
$result = $link->renderLink('u|r:4');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|r:4');
$this->assertEquals('<span >http://example.com</span>', $result);
// $this->assertEquals('<span >http://example.com</span>', $result);
$this->assertEquals('http://example.com', $result);
$result = $link->renderLink('t:Example|r:4');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:4');
$this->assertEquals('<span >http://example.com</span>', $result);
// $this->assertEquals('<span >http://example.com</span>', $result);
$this->assertEquals('http://example.com', $result);
// r: 5
$result = $link->renderLink('u|r:5');
......@@ -248,7 +254,8 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('<a href="?id=secondPage" class="internal" >?id=secondPage</a>', $result);
$result = $link->renderLink('t:Example|r:1');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
$result = $link->renderLink('p:secondPage|t:Example|r:1');
$this->assertEquals('<a href="?id=secondPage" class="internal" >Example</a>', $result);
......@@ -268,29 +275,37 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
// r: 3
$result = $link->renderLink('p|r:3');
$this->assertEquals('<span >?id=firstPage</span>', $result);
// $this->assertEquals('<span >?id=firstPage</span>', $result);
$this->assertEquals('?id=firstPage', $result);
$result = $link->renderLink('p:secondPage|r:3');
$this->assertEquals('<span >?id=secondPage</span>', $result);
// $this->assertEquals('<span >?id=secondPage</span>', $result);
$this->assertEquals('?id=secondPage', $result);
$result = $link->renderLink('t:Example|r:3');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
$result = $link->renderLink('p:secondPage|t:Example|r:3');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
// r: 4
$result = $link->renderLink('p|r:4');
$this->assertEquals('<span >?id=firstPage</span>', $result);
// $this->assertEquals('<span >?id=firstPage</span>', $result);
$this->assertEquals('?id=firstPage', $result);
$result = $link->renderLink('p:secondPage|r:4');
$this->assertEquals('<span >?id=secondPage</span>', $result);
// $this->assertEquals('<span >?id=secondPage</span>', $result);
$this->assertEquals('?id=secondPage', $result);
$result = $link->renderLink('t:Example|r:4');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
$result = $link->renderLink('p:secondPage|t:Example|r:4');
$this->assertEquals('<span >?id=secondPage</span>', $result);
// $this->assertEquals('<span >?id=secondPage</span>', $result);
$this->assertEquals('?id=secondPage', $result);
// r: 5
$result = $link->renderLink('p|r:5');
......@@ -343,7 +358,8 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('<a href="mailto:john@doe.com" >mailto:john@doe.com</a>', $result);
$result = $link->renderLink('t:Example|r:1');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);
$this->assertEquals('Example', $result);
$result = $link->renderLink('m:john@doe.com|t:Example|r:1');
$this->assertEquals('<a href="mailto:john@doe.com" >Example</a>', $result);
......@@ -366,26 +382,32 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', $result);
$result = $link->renderLink('m:john@doe.com|r:3');
$this->assertEquals('<span >mailto:john@doe.com</span>', $result);
// $this->assertEquals('<span >mailto:john@doe.com</span>', $result);
$this->assertEquals('mailto:john@doe.com', $result);
$result = $link->renderLink('t:Example|r:3');
$this->assertEquals('<span >Example</span>', $result);
// $this->assertEquals('<span >Example</span>', $result);