4 * This file is part of Psy Shell.
6 * (c) 2012-2017 Justin Hileman
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
14 use Psy\Configuration;
15 use Psy\ConsoleColorFactory;
17 class ConsoleColorFactoryTest extends \PHPUnit_Framework_TestCase
19 public function testGetConsoleColorAuto()
21 $colorMode = Configuration::COLOR_MODE_AUTO;
22 $factory = new ConsoleColorFactory($colorMode);
23 $colors = $factory->getConsoleColor();
24 $themes = $colors->getThemes();
26 $this->assertFalse($colors->isStyleForced());
27 $this->assertEquals(array('blue'), $themes['line_number']);
30 public function testGetConsoleColorForced()
32 $colorMode = Configuration::COLOR_MODE_FORCED;
33 $factory = new ConsoleColorFactory($colorMode);
34 $colors = $factory->getConsoleColor();
35 $themes = $colors->getThemes();
37 $this->assertTrue($colors->isStyleForced());
38 $this->assertEquals(array('blue'), $themes['line_number']);
41 public function testGetConsoleColorDisabled()
43 $colorMode = Configuration::COLOR_MODE_DISABLED;
44 $factory = new ConsoleColorFactory($colorMode);
45 $colors = $factory->getConsoleColor();
46 $themes = $colors->getThemes();
48 $this->assertFalse($colors->isStyleForced());
49 $this->assertEquals(array('none'), $themes['line_number']);