Skip to content

Commit c43139c

Browse files
jrfnlgrogy
authored andcommitted
Tests: add a dedicated test for the class constructor
1 parent d40f627 commit c43139c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/ConstructorTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace PHP_Parallel_Lint\PhpConsoleHighlighter\Test;
4+
5+
use PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor;
6+
use PHP_Parallel_Lint\PhpConsoleHighlighter\Highlighter;
7+
8+
/**
9+
* @covers PHP_Parallel_Lint\PhpConsoleHighlighter\Highlighter::__construct
10+
*/
11+
class ConstructorTest extends HighlighterTestCase
12+
{
13+
/**
14+
* Test constructor, including integration with ConsoleColor.
15+
*/
16+
public function testConstructor()
17+
{
18+
$color = new ConsoleColor();
19+
// Ensure that at least one style is already set so all branches get tested.
20+
$color->addTheme(Highlighter::TOKEN_DEFAULT, 'bg_light_red');
21+
22+
$highlighter = new Highlighter($color);
23+
$themes = $color->getThemes();
24+
25+
$this->assertNotEmpty($themes);
26+
$this->assertCount(7, $themes);
27+
}
28+
}

0 commit comments

Comments
 (0)