|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Paraunit\Printer; |
|
4
|
|
|
|
|
5
|
|
|
use Paraunit\Lifecycle\EngineEvent; |
|
6
|
|
|
use Symfony\Component\Console\Formatter\OutputFormatterStyle; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class ConsoleFormatter |
|
10
|
|
|
* @package Paraunit\Printer |
|
11
|
|
|
*/ |
|
12
|
|
|
class ConsoleFormatter |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* @param EngineEvent $engineEvent |
|
16
|
|
|
*/ |
|
17
|
7 |
|
public function onEngineStart(EngineEvent $engineEvent) |
|
18
|
|
|
{ |
|
19
|
|
|
|
|
20
|
7 |
|
$outputInterface= $engineEvent->getOutputInterface(); |
|
21
|
|
|
|
|
22
|
7 |
|
if ($outputInterface->getFormatter()) { |
|
23
|
7 |
|
$style = new OutputFormatterStyle('green', null, array('bold', 'blink')); |
|
24
|
7 |
|
$outputInterface->getFormatter()->setStyle('ok', $style); |
|
25
|
|
|
|
|
26
|
7 |
|
$style = new OutputFormatterStyle('yellow', null, array('bold', 'blink')); |
|
27
|
7 |
|
$outputInterface->getFormatter()->setStyle('skipped', $style); |
|
28
|
|
|
|
|
29
|
7 |
|
$style = new OutputFormatterStyle('blue', null, array('bold', 'blink')); |
|
30
|
7 |
|
$outputInterface->getFormatter()->setStyle('incomplete', $style); |
|
31
|
|
|
|
|
32
|
7 |
|
$style = new OutputFormatterStyle('red', null, array('bold', 'blink')); |
|
33
|
7 |
|
$outputInterface->getFormatter()->setStyle('fail', $style); |
|
34
|
|
|
|
|
35
|
7 |
|
$style = new OutputFormatterStyle('red', null, array('bold', 'blink')); |
|
36
|
7 |
|
$outputInterface->getFormatter()->setStyle('error', $style); |
|
37
|
7 |
|
} |
|
38
|
7 |
|
} |
|
39
|
|
|
} |
|
40
|
|
|
|