mageekguy\atoum\cli\clear: lines coverage

100% of 51

OPs

100% of 6

Lines

88% of 8

Branches

100% of 5

Paths
Method OPs OPs % Lines Line % Branches Branches % Paths Path %
mageekguy\atoum\cli\clear::__construct() 10 100% 2 100% 1 0% 1 100%
mageekguy\atoum\cli\clear::setCli() 16 100% 2 100% 1 100% 1 100%
mageekguy\atoum\cli\clear::getCli() 6 100% 1 100% 1 100% 1 100%
mageekguy\atoum\cli\clear::decorate() 19 100% 1 100% 5 100% 2 100%
#
1
<?php
2

                    
3
namespace mageekguy\atoum\cli;
4

                    
5
use
6
	mageekguy\atoum,
7
	mageekguy\atoum\writer
8
;
9

                    
10
class clear implements writer\decorator
11
{
12
	protected $cli = null;
13

                    
14
	public function __construct(atoum\cli $cli = null)100%
15
	{
16
		$this->setCli($cli);
17
	}
18

                    
19
	public function setCli(atoum\cli $cli = null)100%
20
	{
21
		$this->cli = $cli ?: new atoum\cli();
22

                    
23
		return $this;
24
	}
25

                    
26
	public function getCli()100%
27
	{
28
		return $this->cli;
29
	}
30

                    
31
	public function decorate($string)100%
32
	{
33
		return ($this->cli->isTerminal() === false ? PHP_EOL : "\033[1K\r") . $string;
34
	}
35
}