Skip to content

Commit

Permalink
Tests: add a dedicated test for the class constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl authored and grogy committed Feb 4, 2022
1 parent d40f627 commit c43139c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/ConstructorTest.php
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);
}
}

0 comments on commit c43139c

Please sign in to comment.