From 2b27e6314bec127b6b4ed20115ad077623ae2e06 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 19 Feb 2022 14:59:18 +0100 Subject: [PATCH] CS/QA: Tests: move TestWriter to separate file --- phpcs.xml.dist | 3 --- tests/Helpers/TestWriter.php | 24 ++++++++++++++++++++++++ tests/OutputTest.php | 21 +-------------------- 3 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 tests/Helpers/TestWriter.php diff --git a/phpcs.xml.dist b/phpcs.xml.dist index dba4930..86edfd0 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -84,9 +84,6 @@ - - /tests/OutputTest\.php$ - /tests/*\.php$ diff --git a/tests/Helpers/TestWriter.php b/tests/Helpers/TestWriter.php new file mode 100644 index 0000000..0cf9991 --- /dev/null +++ b/tests/Helpers/TestWriter.php @@ -0,0 +1,24 @@ +logs .= $string; + } + + public function getLogs() + { + return $this->logs; + } +} diff --git a/tests/OutputTest.php b/tests/OutputTest.php index ea11686..cbdc0d7 100644 --- a/tests/OutputTest.php +++ b/tests/OutputTest.php @@ -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; @@ -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();