lint: fix line-length warnings

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
VirtualTam 2018-10-13 01:40:04 +02:00
parent 067c2dd8f5
commit 9d9f6d75b9
13 changed files with 132 additions and 44 deletions

View file

@ -76,7 +76,15 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
$this->assertEquals(
self::$refDB->countUntaggedLinks(),
count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, /*$request=*/'', /*$casesensitive=*/false, /*$visibility=*/'all', /*$untaggedonly=*/true))
count(
self::$linkFilter->filter(
LinkFilter::$FILTER_TAG,
/*$request=*/'',
/*$casesensitive=*/false,
/*$visibility=*/'all',
/*$untaggedonly=*/true
)
)
);
$this->assertEquals(
@ -246,7 +254,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
2,
count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars.userfriendly.org'))
);
$this->assertEquals(
2,
count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars org'))
@ -288,12 +296,12 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
1,
count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'publishing media'))
);
$this->assertEquals(
1,
count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'mercurial w3c'))
);
$this->assertEquals(
3,
count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '"free software"'))

View file

@ -83,7 +83,9 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
'Date: Sat, 28 Oct 2017 12:01:33 GMT',
'Content-Type: text/html; charset=utf-8',
'Status: 200 OK',
'end' => 'th=device-width"><title>Refactoring · GitHub</title><link rel="search" type="application/opensea',
'end' => 'th=device-width">'
.'<title>Refactoring · GitHub</title>'
.'<link rel="search" type="application/opensea',
'<title>ignored</title>',
];
foreach ($data as $key => $line) {
@ -106,7 +108,9 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
$callback = get_curl_download_callback($charset, $title, 'ut_curl_getinfo_no_charset');
$data = [
'HTTP/1.1 200 OK',
'end' => 'th=device-width"><title>Refactoring · GitHub</title><link rel="search" type="application/opensea',
'end' => 'th=device-width">'
.'<title>Refactoring · GitHub</title>'
.'<link rel="search" type="application/opensea',
'<title>ignored</title>',
];
foreach ($data as $key => $line) {
@ -126,7 +130,9 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
$data = [
'HTTP/1.1 200 OK',
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',
'end' => 'th=device-width"><title>Refactoring · GitHub</title><link rel="search" type="application/opensea',
'end' => 'th=device-width">'
.'<title>Refactoring · GitHub</title>'
.'<link rel="search" type="application/opensea',
'<title>ignored</title>',
];
foreach ($data as $key => $line) {
@ -211,23 +217,26 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
public function testText2clickableWithoutRedirector()
{
$text = 'stuff http://hello.there/is=someone#here otherstuff';
$expectedText = 'stuff <a href="http://hello.there/is=someone#here">http://hello.there/is=someone#here</a> otherstuff';
$expectedText = 'stuff <a href="http://hello.there/is=someone#here">'
.'http://hello.there/is=someone#here</a> otherstuff';
$processedText = text2clickable($text, '');
$this->assertEquals($expectedText, $processedText);
$text = 'stuff http://hello.there/is=someone#here(please) otherstuff';
$expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)">http://hello.there/is=someone#here(please)</a> otherstuff';
$expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)">'
.'http://hello.there/is=someone#here(please)</a> otherstuff';
$processedText = text2clickable($text, '');
$this->assertEquals($expectedText, $processedText);
$text = 'stuff http://hello.there/is=someone#here(please)&no otherstuff';
$expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)&no">http://hello.there/is=someone#here(please)&no</a> otherstuff';
$expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)&no">'
.'http://hello.there/is=someone#here(please)&no</a> otherstuff';
$processedText = text2clickable($text, '');
$this->assertEquals($expectedText, $processedText);
}
/**
* Test text2clickable a redirector set.
* Test text2clickable with a redirector set.
*/
public function testText2clickableWithRedirector()
{

View file

@ -393,20 +393,32 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
$this->assertEquals('Naming conventions... #private', $linkDB[0]['description']);
$this->assertEquals('samba cartoon web', $linkDB[0]['tags']);
$this->assertTrue($linkDB[0]['private']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_142300'), $linkDB[0]['created']);
$this->assertEquals(
DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_142300'),
$linkDB[0]['created']
);
$this->assertTrue(isset($linkDB[1]));
$this->assertFalse(isset($linkDB[1]['linkdate']));
$this->assertEquals(1, $linkDB[1]['id']);
$this->assertEquals('UserFriendly - Samba', $linkDB[1]['title']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_172539'), $linkDB[1]['created']);
$this->assertEquals(
DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_172539'),
$linkDB[1]['created']
);
$this->assertTrue(isset($linkDB[2]));
$this->assertFalse(isset($linkDB[2]['linkdate']));
$this->assertEquals(2, $linkDB[2]['id']);
$this->assertEquals('Geek and Poke', $linkDB[2]['title']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_182539'), $linkDB[2]['created']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_190301'), $linkDB[2]['updated']);
$this->assertEquals(
DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_182539'),
$linkDB[2]['created']
);
$this->assertEquals(
DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_190301'),
$linkDB[2]['updated']
);
}
/**

View file

@ -127,7 +127,9 @@ class PostLinkTest extends TestCase
$this->assertEquals('', $data['description']);
$this->assertEquals([], $data['tags']);
$this->assertEquals(false, $data['private']);
$this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created']));
$this->assertTrue(
new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
);
$this->assertEquals('', $data['updated']);
$historyEntry = $this->history->getHistory()[0];
@ -170,7 +172,9 @@ class PostLinkTest extends TestCase
$this->assertEquals($link['description'], $data['description']);
$this->assertEquals($link['tags'], $data['tags']);
$this->assertEquals(true, $data['private']);
$this->assertTrue(new \DateTime('2 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created']));
$this->assertTrue(
new \DateTime('2 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
);
$this->assertEquals('', $data['updated']);
}

View file

@ -114,7 +114,9 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
\DateTime::createFromFormat('Ymd_His', '20150310_114651'),
\DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
);
$this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']));
$this->assertTrue(
new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
);
$historyEntry = $this->history->getHistory()[0];
$this->assertEquals(\History::UPDATED, $historyEntry['event']);
@ -159,7 +161,9 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
\DateTime::createFromFormat('Ymd_His', '20150310_114651'),
\DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
);
$this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']));
$this->assertTrue(
new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
);
}
/**