From f9aab3c404ef63cd7f741e490ff3661b3a2b2bd8 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 27 Sep 2020 19:56:19 +0200 Subject: [PATCH] Lint --- tests/ControllerTest.php | 11 +++++----- tests/VideoTest.php | 44 +++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 9e9d5fa..cf9a7b7 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -7,7 +7,6 @@ namespace Alltube\Test; use Alltube\Config; -use Alltube\ConfigFactory; use Alltube\Controller\BaseController; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; @@ -94,7 +93,7 @@ abstract class ControllerTest extends BaseTest * * @return Response HTTP response */ - protected function getRequestResult($request, array $params) + protected function getRequestResult(string $request, array $params) { return $this->controller->$request( $this->request->withQueryParams($params), @@ -110,7 +109,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsOk($request, array $params = []) + protected function assertRequestIsOk(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isOk()); } @@ -123,7 +122,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsRedirect($request, array $params = []) + protected function assertRequestIsRedirect(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isRedirect()); } @@ -136,7 +135,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsServerError($request, array $params = []) + protected function assertRequestIsServerError(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isServerError()); } @@ -149,7 +148,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsClientError($request, array $params = []) + protected function assertRequestIsClientError(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isClientError()); } diff --git a/tests/VideoTest.php b/tests/VideoTest.php index 7f58516..75aeeca 100644 --- a/tests/VideoTest.php +++ b/tests/VideoTest.php @@ -141,7 +141,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider ErrorUrlProvider */ - public function testgetUrlError($url) + public function testgetUrlError(string $url) { $this->expectException(YoutubedlException::class); $video = new Video($this->downloader, $url, $this->format); @@ -258,7 +258,7 @@ class VideoTest extends BaseTest * @dataProvider urlProvider * @dataProvider m3uUrlProvider */ - public function testGetJson($url, $format) + public function testGetJson(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $info = $video->getJson(); @@ -279,7 +279,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider ErrorURLProvider */ - public function testGetJsonError($url) + public function testGetJsonError(string $url) { $this->expectException(YoutubedlException::class); $video = new Video($this->downloader, $url, $this->format); @@ -300,7 +300,7 @@ class VideoTest extends BaseTest * @dataProvider m3uUrlProvider * @dataProvider remuxUrlProvider */ - public function testGetFilename($url, $format, $filename, $extension) + public function testGetFilename(string $url, string $format, string $filename, string $extension) { $video = new Video($this->downloader, $url, $format); $this->assertEquals($video->getFilename(), $filename . '.' . $extension); @@ -315,7 +315,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider ErrorUrlProvider */ - public function testGetFilenameError($url) + public function testGetFilenameError(string $url) { $this->expectException(YoutubedlException::class); $video = new Video($this->downloader, $url, $this->format); @@ -329,10 +329,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider urlProvider * @throws AlltubeLibraryException + * @dataProvider urlProvider */ - public function testGetAudioStream($url, $format) + public function testGetAudioStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getAudioStream($video)); @@ -345,10 +345,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @throws AlltubeLibraryException|ConfigException + * @throws AlltubeLibraryException + * @throws ConfigException * @dataProvider urlProvider */ - public function testGetAudioStreamFfmpegError($url, $format) + public function testGetAudioStreamFfmpegError(string $url, string $format) { $this->expectException(AvconvException::class); Config::setOptions(['ffmpeg' => 'foobar']); @@ -369,7 +370,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider m3uUrlProvider */ - public function testGetAudioStreamM3uError($url, $format) + public function testGetAudioStreamM3uError(string $url, string $format) { $this->expectException(InvalidProtocolConversionException::class); $video = new Video($this->downloader, $url, $format); @@ -426,10 +427,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider m3uUrlProvider * @throws AlltubeLibraryException + * @dataProvider m3uUrlProvider */ - public function testGetM3uStream($url, $format) + public function testGetM3uStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getM3uStream($video)); @@ -442,10 +443,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider remuxUrlProvider * @throws AlltubeLibraryException + * @dataProvider remuxUrlProvider */ - public function testGetRemuxStream($url, $format) + public function testGetRemuxStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getRemuxStream($video)); @@ -461,7 +462,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider urlProvider */ - public function testGetRemuxStreamWithWrongVideo($url, $format) + public function testGetRemuxStreamWithWrongVideo(string $url, string $format) { $this->expectException(RemuxException::class); $video = new Video($this->downloader, $url, $format); @@ -478,7 +479,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider rtmpUrlProvider */ - public function testGetRtmpStream($url, $format) + public function testGetRtmpStream(string $url, string $format) { $this->markTestIncomplete('We need to find another RTMP video.'); @@ -494,10 +495,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @throws AlltubeLibraryException|ConfigException + * @throws AlltubeLibraryException + * @throws ConfigException * @dataProvider m3uUrlProvider */ - public function testGetM3uStreamFfmpegError($url, $format) + public function testGetM3uStreamFfmpegError(string $url, string $format) { $this->expectException(AvconvException::class); Config::setOptions(['ffmpeg' => 'foobar']); @@ -515,10 +517,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider urlProvider * @throws AlltubeLibraryException + * @dataProvider urlProvider */ - public function testGetConvertedStream($url, $format) + public function testGetConvertedStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getConvertedStream($video, 32, 'flv')); @@ -534,7 +536,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider m3uUrlProvider */ - public function testGetConvertedStreamM3uError($url, $format) + public function testGetConvertedStreamM3uError(string $url, string $format) { $this->expectException(InvalidProtocolConversionException::class); $video = new Video($this->downloader, $url, $format);