Skip to content

Commit 2b27e63

Browse files
jrfnlgrogy
authored andcommitted
CS/QA: Tests: move TestWriter to separate file
1 parent 9e024d4 commit 2b27e63

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

Diff for: phpcs.xml.dist

-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@
8484
</rule>
8585

8686
<!-- To be addressed in test refactor. -->
87-
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
88-
<exclude-pattern>/tests/OutputTest\.php$</exclude-pattern>
89-
</rule>
9087
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
9188
<exclude-pattern>/tests/*\.php$</exclude-pattern>
9289
</rule>

Diff for: tests/Helpers/TestWriter.php

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace PHP_Parallel_Lint\PhpParallelLint\Tests\Helpers;
4+
5+
use PHP_Parallel_Lint\PhpParallelLint\Writers\WriterInterface;
6+
7+
class TestWriter implements WriterInterface
8+
{
9+
/** @var string */
10+
protected $logs = "";
11+
12+
/**
13+
* @param string $string
14+
*/
15+
public function write($string)
16+
{
17+
$this->logs .= $string;
18+
}
19+
20+
public function getLogs()
21+
{
22+
return $this->logs;
23+
}
24+
}

Diff for: tests/OutputTest.php

+1-20
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use PHP_Parallel_Lint\PhpParallelLint\Outputs\CheckstyleOutput;
1616
use PHP_Parallel_Lint\PhpParallelLint\Outputs\GitLabOutput;
1717
use PHP_Parallel_Lint\PhpParallelLint\Result;
18-
use PHP_Parallel_Lint\PhpParallelLint\Writers\WriterInterface;
18+
use PHP_Parallel_Lint\PhpParallelLint\Tests\Helpers\TestWriter;
1919
use Tester\Assert;
2020
use Tester\TestCase;
2121

@@ -100,24 +100,5 @@ public function getGitLabOutputData()
100100
}
101101
}
102102

103-
class TestWriter implements WriterInterface
104-
{
105-
/** @var string */
106-
protected $logs = "";
107-
108-
/**
109-
* @param string $string
110-
*/
111-
public function write($string)
112-
{
113-
$this->logs .= $string;
114-
}
115-
116-
public function getLogs()
117-
{
118-
return $this->logs;
119-
}
120-
}
121-
122103
$testCase = new OutputTest();
123104
$testCase->run();

0 commit comments

Comments
 (0)