Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0bd00a8

Browse files
jrfnlgrogy
authored andcommitted
Tests: one class per file
Move the `ConsoleColorWithForceSupport` fixture used in the tests to a separate file.
1 parent 7f1cde3 commit 0bd00a8

File tree

2 files changed

+32
-27
lines changed

2 files changed

+32
-27
lines changed

‎tests/ConsoleColorTest.php‎

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,9 @@
22
namespace PHP_Parallel_Lint\PhpConsoleColor\Test;
33

44
use PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor;
5+
use PHP_Parallel_Lint\PhpConsoleColor\Test\Fixtures\ConsoleColorWithForceSupport;
56
use PHPUnit\Framework\TestCase;
67

7-
class ConsoleColorWithForceSupport extends ConsoleColor
8-
{
9-
private $isSupportedForce = true;
10-
11-
private $are256ColorsSupportedForce = true;
12-
13-
public function setIsSupported($isSupported)
14-
{
15-
$this->isSupportedForce = $isSupported;
16-
}
17-
18-
public function isSupported()
19-
{
20-
return $this->isSupportedForce;
21-
}
22-
23-
public function setAre256ColorsSupported($are256ColorsSupported)
24-
{
25-
$this->are256ColorsSupportedForce = $are256ColorsSupported;
26-
}
27-
28-
public function are256ColorsSupported()
29-
{
30-
return $this->are256ColorsSupportedForce;
31-
}
32-
}
33-
348
class ConsoleColorTest extends TestCase
359
{
3610
/** @var ConsoleColorWithForceSupport */
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
namespace PHP_Parallel_Lint\PhpConsoleColor\Test\Fixtures;
3+
4+
use PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor;
5+
6+
class ConsoleColorWithForceSupport extends ConsoleColor
7+
{
8+
private $isSupportedForce = true;
9+
10+
private $are256ColorsSupportedForce = true;
11+
12+
public function setIsSupported($isSupported)
13+
{
14+
$this->isSupportedForce = $isSupported;
15+
}
16+
17+
public function isSupported()
18+
{
19+
return $this->isSupportedForce;
20+
}
21+
22+
public function setAre256ColorsSupported($are256ColorsSupported)
23+
{
24+
$this->are256ColorsSupportedForce = $are256ColorsSupported;
25+
}
26+
27+
public function are256ColorsSupported()
28+
{
29+
return $this->are256ColorsSupportedForce;
30+
}
31+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /