Security update for Core, with self-updated composer
[yaffs-website] / vendor / psy / psysh / test / Psy / Test / ConsoleColorFactoryTest.php
1 <?php
2
3 /*
4  * This file is part of Psy Shell.
5  *
6  * (c) 2012-2017 Justin Hileman
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Psy\Test;
13
14 use Psy\Configuration;
15 use Psy\ConsoleColorFactory;
16
17 class ConsoleColorFactoryTest extends \PHPUnit\Framework\TestCase
18 {
19     public function testGetConsoleColorAuto()
20     {
21         $colorMode = Configuration::COLOR_MODE_AUTO;
22         $factory   = new ConsoleColorFactory($colorMode);
23         $colors    = $factory->getConsoleColor();
24         $themes    = $colors->getThemes();
25
26         $this->assertFalse($colors->isStyleForced());
27         $this->assertEquals(array('blue'), $themes['line_number']);
28     }
29
30     public function testGetConsoleColorForced()
31     {
32         $colorMode = Configuration::COLOR_MODE_FORCED;
33         $factory   = new ConsoleColorFactory($colorMode);
34         $colors    = $factory->getConsoleColor();
35         $themes    = $colors->getThemes();
36
37         $this->assertTrue($colors->isStyleForced());
38         $this->assertEquals(array('blue'), $themes['line_number']);
39     }
40
41     public function testGetConsoleColorDisabled()
42     {
43         $colorMode = Configuration::COLOR_MODE_DISABLED;
44         $factory   = new ConsoleColorFactory($colorMode);
45         $colors    = $factory->getConsoleColor();
46         $themes    = $colors->getThemes();
47
48         $this->assertFalse($colors->isStyleForced());
49         $this->assertEquals(array('none'), $themes['line_number']);
50     }
51 }