diff --git a/composer.json b/composer.json index a9e6656..0e978cd 100644 --- a/composer.json +++ b/composer.json @@ -6,17 +6,17 @@ "require": { "php": "^7.1", - "symfony/process": "^3.0|^4.0", - "symfony/console": "^3.0|^4.0", - "symfony/finder": "^3.0|^4.0", + "symfony/process": "^3.0|^4.0|^5.0", + "symfony/console": "^3.0|^4.0|^5.0", + "symfony/finder": "^3.0|^4.0|^5.0", "nikic/php-parser": "^3.0", "league/commonmark": "^0.13", "gregwar/rst": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^7.0", - "mikey179/vfsStream": "^1.6" + "phpunit/phpunit": "^7.5", + "mikey179/vfsstream": "^1.6" }, "autoload": { "psr-4": { "Rusty\\": "src/" } diff --git a/tests/CodeSampleCompilerTest.php b/tests/CodeSampleCompilerTest.php index 05e142b..8f1d7ea 100644 --- a/tests/CodeSampleCompilerTest.php +++ b/tests/CodeSampleCompilerTest.php @@ -9,7 +9,7 @@ class CodeSampleCompilerTest extends TestCase { - public function testItTransformsAssertCalls() + public function testItTransformsAssertCalls(): void { $sample = new CodeSample($this->getFileMock(), 42, 'assert(42 === 42);'); $runtimeNSDir = $this->getRuntimeNSDir(); @@ -25,7 +25,7 @@ public function testItTransformsAssertCalls() $this->assertSame($expectedCode, $compiler->compile($sample, new ExecutionContext(['./target-dir/']))); } - public function testItAllowsBootstrapFilesToBePrepended() + public function testItAllowsBootstrapFilesToBePrepended(): void { $sample = new CodeSample($this->getFileMock(), 42, 'new Foo();'); $context = new ExecutionContext(['./target-dir/'], ['/some/bootstrap.php', '/other/bootstrap.php']); diff --git a/tests/CodeSampleTest.php b/tests/CodeSampleTest.php index e92e8bd..8034865 100644 --- a/tests/CodeSampleTest.php +++ b/tests/CodeSampleTest.php @@ -7,7 +7,7 @@ class CodeSampleTest extends TestCase { - public function testItBehavesLikeAContainer() + public function testItBehavesLikeAContainer(): void { /** @var \SplFileInfo $splFileInfoMock */ $splFileInfoMock = $this->createMock(\SplFileInfo::class); @@ -25,7 +25,7 @@ public function testItBehavesLikeAContainer() $this->assertFalse($sample->hasPragma('other directive')); } - public function testItStripsPHPStartingTagFromCode() + public function testItStripsPHPStartingTagFromCode(): void { /** @var \SplFileInfo $splFileInfoMock */ $splFileInfoMock = $this->createMock(\SplFileInfo::class); diff --git a/tests/Extractor/MarkdownTest.php b/tests/Extractor/MarkdownTest.php index 8d8f93a..a712bf2 100644 --- a/tests/Extractor/MarkdownTest.php +++ b/tests/Extractor/MarkdownTest.php @@ -29,7 +29,7 @@ public static function documents() /** * set up test environmemt */ - public function setUp() + public function setUp(): void { $documents = self::documents(); @@ -39,7 +39,7 @@ public function setUp() /** * @dataProvider documentsProvider */ - public function testItExtractsSamplesFromFencedCodeBlocks($documentFile, array $documentData) + public function testItExtractsSamplesFromFencedCodeBlocks($documentFile, array $documentData): void { $file = $this->getFileMock($this->fs->url().'/'.$documentFile); $extractor = new Extractor\Markdown(); diff --git a/tests/Extractor/RstTest.php b/tests/Extractor/RstTest.php index 194d3ad..e8a2072 100644 --- a/tests/Extractor/RstTest.php +++ b/tests/Extractor/RstTest.php @@ -28,7 +28,7 @@ public static function documents() /** * set up test environmemt */ - public function setUp() + public function setUp(): void { $documents = self::documents(); @@ -38,7 +38,7 @@ public function setUp() /** * @dataProvider documentsProvider */ - public function testItExtractsSamplesFromFencedCodeBlocks($documentFile, array $documentData) + public function testItExtractsSamplesFromFencedCodeBlocks($documentFile, array $documentData): void { $file = $this->getFileMock($this->fs->url().'/'.$documentFile); $extractor = new Extractor\Rst(); diff --git a/tests/Lint/PHPParserLinterTest.php b/tests/Lint/PHPParserLinterTest.php index f4effb5..24ce2ca 100644 --- a/tests/Lint/PHPParserLinterTest.php +++ b/tests/Lint/PHPParserLinterTest.php @@ -12,7 +12,7 @@ class PHPParserLinterTest extends TestCase /** * @dataProvider validInputProvider */ - public function testValidCodeThrowNoError(string $code) + public function testValidCodeThrowNoError(string $code): void { /** @var \SplFileInfo $splFileInfoMock */ $splFileInfoMock = $this->createMock(\SplFileInfo::class); @@ -32,10 +32,11 @@ public function validInputProvider() /** * @dataProvider invalidInputProvider - * @expectedException \Rusty\Lint\Exception\SyntaxError */ - public function testInvalidCodeThrowAnError(string $code) + public function testInvalidCodeThrowAnError(string $code): void { + $this->expectException(\Rusty\Lint\Exception\SyntaxError::class); + /** @var \SplFileInfo $splFileInfoMock */ $splFileInfoMock = $this->createMock(\SplFileInfo::class); $sample = new CodeSample($splFileInfoMock, 42, $code); diff --git a/tests/PragmaParserTest.php b/tests/PragmaParserTest.php index 5b4651f..75efcc3 100644 --- a/tests/PragmaParserTest.php +++ b/tests/PragmaParserTest.php @@ -10,7 +10,7 @@ class PragmaParserTest extends TestCase /** * @dataProvider inputProvider */ - public function testItParsesPragmaDirectives(string $input, array $expectedDirectives) + public function testItParsesPragmaDirectives(string $input, array $expectedDirectives): void { $parser = new PragmaParser(); diff --git a/tests/Reports/BlackholeReporterTest.php b/tests/Reports/BlackholeReporterTest.php index 7cc4188..7e1b27c 100644 --- a/tests/Reports/BlackholeReporterTest.php +++ b/tests/Reports/BlackholeReporterTest.php @@ -7,7 +7,7 @@ class BlackholeReporterTest extends TestCase { - public function testItDoesNothing() + public function testItDoesNothing(): void { $splFile = $this->createMock(\SplFileInfo::class); $reporter = new Reports\BlackholeReporter(); diff --git a/tests/Reports/ConsoleReporterTest.php b/tests/Reports/ConsoleReporterTest.php index 267c2db..418cc72 100644 --- a/tests/Reports/ConsoleReporterTest.php +++ b/tests/Reports/ConsoleReporterTest.php @@ -15,7 +15,7 @@ class ConsoleReporterTest extends TestCase /** * @dataProvider reportProvider */ - public function testHandledReportsAreDisplayed(Reports\Report $report) + public function testHandledReportsAreDisplayed(Reports\Report $report): void { $output = $this->createMock(OutputInterface::class); $formatter = $this->createMock(FormatterHelper::class);