Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/" }
Expand Down
4 changes: 2 additions & 2 deletions tests/CodeSampleCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions tests/CodeSampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class CodeSampleTest extends TestCase
{
public function testItBehavesLikeAContainer()
public function testItBehavesLikeAContainer(): void
{
/** @var \SplFileInfo $splFileInfoMock */
$splFileInfoMock = $this->createMock(\SplFileInfo::class);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/Extractor/MarkdownTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function documents()
/**
* set up test environmemt
*/
public function setUp()
public function setUp(): void
{
$documents = self::documents();

Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/Extractor/RstTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function documents()
/**
* set up test environmemt
*/
public function setUp()
public function setUp(): void
{
$documents = self::documents();

Expand All @@ -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();
Expand Down
7 changes: 4 additions & 3 deletions tests/Lint/PHPParserLinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/PragmaParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion tests/Reports/BlackholeReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class BlackholeReporterTest extends TestCase
{
public function testItDoesNothing()
public function testItDoesNothing(): void
{
$splFile = $this->createMock(\SplFileInfo::class);
$reporter = new Reports\BlackholeReporter();
Expand Down
2 changes: 1 addition & 1 deletion tests/Reports/ConsoleReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down