-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: add a dedicated test for the class constructor
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace PHP_Parallel_Lint\PhpConsoleHighlighter\Test; | ||
|
||
use PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor; | ||
use PHP_Parallel_Lint\PhpConsoleHighlighter\Highlighter; | ||
|
||
/** | ||
* @covers PHP_Parallel_Lint\PhpConsoleHighlighter\Highlighter::__construct | ||
*/ | ||
class ConstructorTest extends HighlighterTestCase | ||
{ | ||
/** | ||
* Test constructor, including integration with ConsoleColor. | ||
*/ | ||
public function testConstructor() | ||
{ | ||
$color = new ConsoleColor(); | ||
// Ensure that at least one style is already set so all branches get tested. | ||
$color->addTheme(Highlighter::TOKEN_DEFAULT, 'bg_light_red'); | ||
|
||
$highlighter = new Highlighter($color); | ||
$themes = $color->getThemes(); | ||
|
||
$this->assertNotEmpty($themes); | ||
$this->assertCount(7, $themes); | ||
} | ||
} |