From 606aea047f46b0f8efb606a976612e843e8f983c Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 4 Dec 2021 21:12:34 +0100 Subject: [PATCH] Tests: one class per file Move the `ConsoleColorWithForceSupport` fixture used in the tests to a separate file. --- tests/ConsoleColorTest.php | 28 +---------------- .../Fixtures/ConsoleColorWithForceSupport.php | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 27 deletions(-) create mode 100644 tests/Fixtures/ConsoleColorWithForceSupport.php diff --git a/tests/ConsoleColorTest.php b/tests/ConsoleColorTest.php index c9f09b7..1d2a520 100644 --- a/tests/ConsoleColorTest.php +++ b/tests/ConsoleColorTest.php @@ -2,35 +2,9 @@ namespace PHP_Parallel_Lint\PhpConsoleColor\Test; use PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor; +use PHP_Parallel_Lint\PhpConsoleColor\Test\Fixtures\ConsoleColorWithForceSupport; use PHPUnit\Framework\TestCase; -class ConsoleColorWithForceSupport extends ConsoleColor -{ - private $isSupportedForce = true; - - private $are256ColorsSupportedForce = true; - - public function setIsSupported($isSupported) - { - $this->isSupportedForce = $isSupported; - } - - public function isSupported() - { - return $this->isSupportedForce; - } - - public function setAre256ColorsSupported($are256ColorsSupported) - { - $this->are256ColorsSupportedForce = $are256ColorsSupported; - } - - public function are256ColorsSupported() - { - return $this->are256ColorsSupportedForce; - } -} - class ConsoleColorTest extends TestCase { /** @var ConsoleColorWithForceSupport */ diff --git a/tests/Fixtures/ConsoleColorWithForceSupport.php b/tests/Fixtures/ConsoleColorWithForceSupport.php new file mode 100644 index 0000000..b27623e --- /dev/null +++ b/tests/Fixtures/ConsoleColorWithForceSupport.php @@ -0,0 +1,31 @@ +isSupportedForce = $isSupported; + } + + public function isSupported() + { + return $this->isSupportedForce; + } + + public function setAre256ColorsSupported($are256ColorsSupported) + { + $this->are256ColorsSupportedForce = $are256ColorsSupported; + } + + public function are256ColorsSupported() + { + return $this->are256ColorsSupportedForce; + } +}