Skip to content

Commit

Permalink
ConsoleColor::getThemes(): add perfunctory unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl authored and grogy committed Dec 16, 2021
1 parent 7f2dc09 commit b0bb1ae
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/ConsoleColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,28 @@ public function testOwnWithStyle()
$this->assertSame("\033[1;2;3mtext\033[0m", $output);
}

/**
* @covers ::getThemes
*/
public function testGetThemes()
{
$this->assertSame(array(), $this->uut->getThemes());

$this->uut->addTheme('bold_dark', array('bold', 'dark'));
$this->uut->addTheme('dark_italic', array('dark', 'italic'));

$themes = $this->uut->getThemes();
if (\method_exists($this, 'assertIsArray')) {
// PHPUnit 7.5+.
$this->assertIsArray($themes);
} else {
// PHPUnit < 7.5.
$this->assertInternalType('array', $themes);
}

$this->assertCount(2, $themes);
}

public function testHasAndRemoveTheme()
{
$this->assertFalse($this->uut->hasTheme('bold_dark'));
Expand Down

0 comments on commit b0bb1ae

Please sign in to comment.