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

Link.php, Report.php: removed parameter 'fr_error'.

parent 0bb95af6
......@@ -22,8 +22,6 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
// TODO: - Question implementieren. NAME_QUESTION!='' wird als Flag verwendet ob eine Question gerendert werden soll. Manual fuer Text & Button ist nicht definiert.
namespace qfq;
//use qfq;
......@@ -161,9 +159,6 @@ class Link {
*/
private $store = null;
// Simulate global variable: will be set much earlier in other functions. Will be shown in error messages.
private $fr_error;
/**
* @var bool
*/
......@@ -242,13 +237,11 @@ class Link {
/**
* __construct
*
* @param $fr_error
* @param Sip $sip
* @param bool $phpUnit
*/
public function __construct($fr_error, Sip $sip, $phpUnit = false) {
public function __construct(Sip $sip, $phpUnit = false) {
$this->phpUnit = $phpUnit;
$this->fr_error = $fr_error;
$this->sip = $sip;
$this->store = Store::getInstance('', $phpUnit);
$this->cssLinkClassInternal = $this->store->getVar(SYSTEM_CSS_LINK_CLASS_INTERNAL, STORE_SYSTEM);
......
......@@ -114,7 +114,7 @@ class Report {
$this->sip->sipUniqId('badcaffee1234');
}
$this->link = new Link($this->fr_error, $this->sip, $phpUnit);
$this->link = new Link($this->sip, $phpUnit);
$this->store = Store::getInstance();
......
......@@ -29,7 +29,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testUnknownTokenException1() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$link->renderLink('b:hello world');
}
......@@ -38,7 +38,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testUnknownTokenException2() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$link->renderLink('abc:hello world');
}
......@@ -47,7 +47,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testLinkUrlBasic() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
Store::setVar(TYPO3_PAGE_ID, 'firstPage', STORE_TYPO3);
......@@ -75,7 +75,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
*
*/
public function testLinkUrlBasicExceptionDouble() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$link->renderLink('u:http://example.com|u:http://new.org');
}
......@@ -85,7 +85,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
*
*/
public function testLinkUrlBasicExceptionEmpty1() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$link->renderLink('u');
}
......@@ -95,7 +95,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
*
*/
public function testLinkUrlBasicExceptionEmpty2() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$link->renderLink('u:');
}
......@@ -104,7 +104,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testLinkPageBasic() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
Store::setVar(TYPO3_PAGE_ID, 'firstPage', STORE_TYPO3);
$result = $link->renderLink('p');
......@@ -130,7 +130,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testLinkMailBasic() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$result = $link->renderLink('m:john@doe.com');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >mailto:john@doe.com</a>', $result);
......@@ -144,7 +144,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
*
*/
public function testLinkMailBasicExceptionMissing1() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$link->renderLink('m');
}
......@@ -154,7 +154,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
*
*/
public function testLinkMailBasicExceptionMissing2() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$link->renderLink('m:');
}
......@@ -163,7 +163,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testMailEncryption() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
//TODO: aktivieren sobald encrypted Mails implemented.
// $result = $link->renderLink('m:john@doe.com|e');
......@@ -183,7 +183,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws UserReportException
*/
public function testRenderModeUrl() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
Store::setVar(TYPO3_PAGE_ID, 'firstPage', STORE_TYPO3);
......@@ -269,7 +269,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws UserReportException
*/
public function testRenderModePage() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
Store::setVar(TYPO3_PAGE_ID, 'firstPage', STORE_TYPO3);
// r: default (0)
......@@ -377,7 +377,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws UserReportException
*/
public function testRenderModeMail() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$result = $link->renderLink('m:john@doe.com');
......@@ -461,7 +461,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws UserReportException
*/
public function testRenderModeUrlPicture() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$result = $link->renderLink('u:http://example.com|P:picture.gif');
......@@ -546,7 +546,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws UserReportException
*/
public function testIcons() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$result = $link->renderLink('u:http://example.com|E');
$this->assertEquals('<a href="http://example.com" class="btn btn-default" title="Edit" ><span class="glyphicon glyphicon-pencil" ></span></a>', $result);
......@@ -574,7 +574,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws UserReportException
*/
public function testBullet() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$result = $link->renderLink('u:http://example.com|B');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet green" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="green" ></a>', $result);
......@@ -605,7 +605,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws UserReportException
*/
public function testChecked() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$result = $link->renderLink('u:http://example.com|C');
$this->assertEquals('<a href="http://example.com" ><img alt="Checked green" src="typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="green" ></a>', $result);
......@@ -636,7 +636,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testPictureException1() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$link->renderLink('u:http://www.example.com|P:picture.gif|B');
......@@ -646,7 +646,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testPictureException2() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$link->renderLink('u:http://www.example.com|C|B');
......@@ -656,7 +656,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testPictureException3() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$link->renderLink('u:http://www.example.com|B:green|B:red');
......@@ -666,7 +666,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testPictureException4() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$link->renderLink('u:http://www.example.com|C:green|C:red');
......@@ -676,7 +676,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testLinkUrlParam() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$result = $link->renderLink('u:http://example.com|U:');
$this->assertEquals('<a href="http://example.com" class="external" >http://example.com</a>', $result);
......@@ -719,7 +719,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testTooltip() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// standard case
$result = $link->renderLink('u:http://example.com|o:hello world');
......@@ -758,7 +758,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testAltText() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// standard case
$result = $link->renderLink('u:http://example.com|a:hello world|P:image.gif');
......@@ -779,7 +779,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testClass() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// no class
$result = $link->renderLink('u:http://example.com|c:n');
......@@ -814,7 +814,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testTarget() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// no target
$result = $link->renderLink('u:http://example.com|g');
......@@ -841,7 +841,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testRight() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// Bullet, LEFT (Standard)
$result = $link->renderLink('u:http://example.com|t:Hello World|B');
......@@ -877,7 +877,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testSip() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// Sip: URL, s
$result = $link->renderLink('u:?form&r=12&xId=2345&L=1&type=99&gId=55|s');
......@@ -908,7 +908,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testSipException1() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$link->renderLink('u:http://www.example.com|s:s');
......@@ -918,7 +918,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @expectedException \qfq\UserReportException
*/
public function testSipException2() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
// r: default (0)
$link->renderLink('u:http://www.example.com|s:2');
......@@ -928,7 +928,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
* @throws SyntaxReportException
*/
public function testQuestion() {
$link = new Link(null, $this->sip, true);
$link = new Link($this->sip, true);
$js = <<<EOF
id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Please confirm', type: 'info', modal: true, timeout: 0, buttons: [
......
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