Skip to content

Commit 3a8ed08

Browse files
committed
ConsoleColor::getThemes(): add perfunctory unit test
1 parent 69d6b1e commit 3a8ed08

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/ConsoleColorTest.php

+22
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ public function testOwnWithStyle()
123123
$this->assertSame("\033[1;2;3mtext\033[0m", $output);
124124
}
125125

126+
/**
127+
* @covers ::getThemes
128+
*/
129+
public function testGetThemes()
130+
{
131+
$this->assertSame(array(), $this->uut->getThemes());
132+
133+
$this->uut->addTheme('bold_dark', array('bold', 'dark'));
134+
$this->uut->addTheme('dark_italic', array('dark', 'italic'));
135+
136+
$themes = $this->uut->getThemes();
137+
if (\method_exists($this, 'assertIsArray')) {
138+
// PHPUnit 7.5+.
139+
$this->assertIsArray($themes);
140+
} else {
141+
// PHPUnit < 7.5.
142+
$this->assertInternalType('array', $themes);
143+
}
144+
145+
$this->assertCount(2, $themes);
146+
}
147+
126148
public function testHasAndRemoveTheme()
127149
{
128150
$this->assertFalse($this->uut->hasTheme('bold_dark'));

0 commit comments

Comments
 (0)