From 9d9f6d75b94aab51067bdfbe50b58b66d1194f6d Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 13 Oct 2018 01:40:04 +0200 Subject: lint: fix line-length warnings Signed-off-by: VirtualTam --- tests/LinkFilterTest.php | 16 ++++++++++++---- tests/LinkUtilsTest.php | 23 ++++++++++++++++------- tests/Updater/UpdaterTest.php | 20 ++++++++++++++++---- tests/api/controllers/links/PostLinkTest.php | 8 ++++++-- tests/api/controllers/links/PutLinkTest.php | 8 ++++++-- 5 files changed, 56 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/LinkFilterTest.php b/tests/LinkFilterTest.php index 250046f8..eb54c359 100644 --- a/tests/LinkFilterTest.php +++ b/tests/LinkFilterTest.php @@ -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"')) diff --git a/tests/LinkUtilsTest.php b/tests/LinkUtilsTest.php index ca062f05..5407159a 100644 --- a/tests/LinkUtilsTest.php +++ b/tests/LinkUtilsTest.php @@ -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">Refactoring · GitHub' + .'Refactoring · GitHub' + .'Refactoring · GitHub' + .'Refactoring · GitHub' + .'', - 'end' => 'th=device-width">Refactoring · GitHub' + .'Refactoring · GitHub' + .'http://hello.there/is=someone#here otherstuff'; + $expectedText = 'stuff ' + .'http://hello.there/is=someone#here otherstuff'; $processedText = text2clickable($text, ''); $this->assertEquals($expectedText, $processedText); $text = 'stuff http://hello.there/is=someone#here(please) otherstuff'; - $expectedText = 'stuff http://hello.there/is=someone#here(please) otherstuff'; + $expectedText = 'stuff ' + .'http://hello.there/is=someone#here(please) otherstuff'; $processedText = text2clickable($text, ''); $this->assertEquals($expectedText, $processedText); $text = 'stuff http://hello.there/is=someone#here(please)&no otherstuff'; - $expectedText = 'stuff http://hello.there/is=someone#here(please)&no otherstuff'; + $expectedText = 'stuff ' + .'http://hello.there/is=someone#here(please)&no otherstuff'; $processedText = text2clickable($text, ''); $this->assertEquals($expectedText, $processedText); } /** - * Test text2clickable a redirector set. + * Test text2clickable with a redirector set. */ public function testText2clickableWithRedirector() { diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index 870f169a..c4a6e7ef 100644 --- a/tests/Updater/UpdaterTest.php +++ b/tests/Updater/UpdaterTest.php @@ -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'] + ); } /** diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php index 37617611..5c2b5623 100644 --- a/tests/api/controllers/links/PostLinkTest.php +++ b/tests/api/controllers/links/PostLinkTest.php @@ -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']); } diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php index 72b895f2..f276b4c1 100644 --- a/tests/api/controllers/links/PutLinkTest.php +++ b/tests/api/controllers/links/PutLinkTest.php @@ -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']) + ); } /** -- cgit v1.2.3