From 067c2dd8f5f6eb6cc808ddc4bd30aec104caf73d Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 13 Oct 2018 00:35:47 +0200 Subject: lint: apply phpcbf to tests/ Signed-off-by: VirtualTam --- tests/api/ApiUtilsTest.php | 3 +-- tests/api/controllers/history/HistoryTest.php | 1 - tests/api/controllers/info/InfoTest.php | 4 ++-- tests/api/controllers/links/PostLinkTest.php | 1 - tests/api/controllers/links/PutLinkTest.php | 1 - tests/api/controllers/tags/PutTagTest.php | 1 - 6 files changed, 3 insertions(+), 8 deletions(-) (limited to 'tests/api') diff --git a/tests/api/ApiUtilsTest.php b/tests/api/ApiUtilsTest.php index 62baf4c5..df4e189a 100644 --- a/tests/api/ApiUtilsTest.php +++ b/tests/api/ApiUtilsTest.php @@ -4,7 +4,6 @@ namespace Shaarli\Api; use Shaarli\Base64Url; - /** * Class ApiUtilsTest */ @@ -34,7 +33,7 @@ class ApiUtilsTest extends \PHPUnit_Framework_TestCase $payload = Base64Url::encode('{ "iat": '. time() .' }'); - $signature = Base64Url::encode(hash_hmac('sha512', $header .'.'. $payload , $secret, true)); + $signature = Base64Url::encode(hash_hmac('sha512', $header .'.'. $payload, $secret, true)); return $header .'.'. $payload .'.'. $signature; } diff --git a/tests/api/controllers/history/HistoryTest.php b/tests/api/controllers/history/HistoryTest.php index 61046d97..ff34e16d 100644 --- a/tests/api/controllers/history/HistoryTest.php +++ b/tests/api/controllers/history/HistoryTest.php @@ -3,7 +3,6 @@ namespace Shaarli\Api\Controllers; - use Shaarli\Config\ConfigManager; use Slim\Container; use Slim\Http\Environment; diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php index f7e63bfa..e437082a 100644 --- a/tests/api/controllers/info/InfoTest.php +++ b/tests/api/controllers/info/InfoTest.php @@ -10,9 +10,9 @@ use Slim\Http\Response; /** * Class InfoTest - * + * * Test REST API controller Info. - * + * * @package Api\Controllers */ class InfoTest extends \PHPUnit_Framework_TestCase diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php index 100a9170..37617611 100644 --- a/tests/api/controllers/links/PostLinkTest.php +++ b/tests/api/controllers/links/PostLinkTest.php @@ -2,7 +2,6 @@ namespace Shaarli\Api\Controllers; - use PHPUnit\Framework\TestCase; use Shaarli\Config\ConfigManager; use Slim\Container; diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php index 8a562571..72b895f2 100644 --- a/tests/api/controllers/links/PutLinkTest.php +++ b/tests/api/controllers/links/PutLinkTest.php @@ -3,7 +3,6 @@ namespace Shaarli\Api\Controllers; - use Shaarli\Config\ConfigManager; use Slim\Container; use Slim\Http\Environment; diff --git a/tests/api/controllers/tags/PutTagTest.php b/tests/api/controllers/tags/PutTagTest.php index 6f7dec22..38017243 100644 --- a/tests/api/controllers/tags/PutTagTest.php +++ b/tests/api/controllers/tags/PutTagTest.php @@ -3,7 +3,6 @@ namespace Shaarli\Api\Controllers; - use Shaarli\Api\Exceptions\ApiBadParametersException; use Shaarli\Config\ConfigManager; use Slim\Container; -- cgit v1.2.3 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/api/controllers/links/PostLinkTest.php | 8 ++++++-- tests/api/controllers/links/PutLinkTest.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'tests/api') 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