Skip to content

Commit

Permalink
CS/QA: Tests: move TestWriter to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl authored and grogy committed Mar 4, 2022
1 parent 9e024d4 commit 2b27e63
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
3 changes: 0 additions & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
</rule>

<!-- To be addressed in test refactor. -->
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>/tests/OutputTest\.php$</exclude-pattern>
</rule>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>/tests/*\.php$</exclude-pattern>
</rule>
Expand Down
24 changes: 24 additions & 0 deletions tests/Helpers/TestWriter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace PHP_Parallel_Lint\PhpParallelLint\Tests\Helpers;

use PHP_Parallel_Lint\PhpParallelLint\Writers\WriterInterface;

class TestWriter implements WriterInterface
{
/** @var string */
protected $logs = "";

/**
* @param string $string
*/
public function write($string)
{
$this->logs .= $string;
}

public function getLogs()
{
return $this->logs;
}
}
21 changes: 1 addition & 20 deletions tests/OutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use PHP_Parallel_Lint\PhpParallelLint\Outputs\CheckstyleOutput;
use PHP_Parallel_Lint\PhpParallelLint\Outputs\GitLabOutput;
use PHP_Parallel_Lint\PhpParallelLint\Result;
use PHP_Parallel_Lint\PhpParallelLint\Writers\WriterInterface;
use PHP_Parallel_Lint\PhpParallelLint\Tests\Helpers\TestWriter;
use Tester\Assert;
use Tester\TestCase;

Expand Down Expand Up @@ -100,24 +100,5 @@ public function getGitLabOutputData()
}
}

class TestWriter implements WriterInterface
{
/** @var string */
protected $logs = "";

/**
* @param string $string
*/
public function write($string)
{
$this->logs .= $string;
}

public function getLogs()
{
return $this->logs;
}
}

$testCase = new OutputTest();
$testCase->run();

0 comments on commit 2b27e63

Please # to comment.