mageekguy\atoum\report\fields\runner\errors: lines coverage

74% of 111

OPs

67% of 27

Lines

43% of 35

Branches

23% of 13

Paths
Method OPs OPs % Lines Line % Branches Branches % Paths Path %
mageekguy\atoum\report\fields\runner\errors::getRunner() 6 100% 1 100% 1 100% 1 100%
mageekguy\atoum\report\fields\runner\errors::handleEvent() 26 96% 5 100% 4 75% 2 100%
mageekguy\atoum\report\fields\runner\errors::getType() 79 65% 21 57% 30 37% 10 0%
#
1
<?php
2

                    
3
namespace mageekguy\atoum\report\fields\runner;
4

                    
5
use
6
	mageekguy\atoum\locale,
7
	mageekguy\atoum\runner,
8
	mageekguy\atoum\report,
9
	mageekguy\atoum\observable
10
;
11

                    
12
abstract class errors extends report\field
13
{
14
	protected $runner = null;
15

                    
16
	public function __construct()
17
	{
18
		parent::__construct(array(runner::runStop));
19
	}
20

                    
21
	public function getRunner()100%
22
	{
23
		return $this->runner;
24
	}
25

                    
26
	public function handleEvent($event, observable $observable)100%
27
	{
28
		if (parent::handleEvent($event, $observable) === false)
29
		{
30
			return false;
31
		}
32
		else
33
		{
34
			$this->runner = $observable;
35

                    
36
			return true;
37
		}
38
	}
39

                    
40
	public static function getType($error)57%
41
	{
42
		switch ($error)
43
		{
44
			case E_ERROR:
45
				return 'E_ERROR';
46

                    
47
			case E_WARNING:
48
				return 'E_WARNING';
49

                    
50
			case E_NOTICE:
51
				return 'E_NOTICE';
52

                    
53
			case E_USER_NOTICE:
54
				return 'E_USER_NOTICE';
55

                    
56
			case E_USER_WARNING:
57
				return 'E_USER_WARNING';
58

                    
59
			case E_USER_ERROR:
60
				return 'E_USER_ERROR';
61

                    
62
			case E_RECOVERABLE_ERROR:
63
				return 'E_RECOVERABLE_ERROR';
64

                    
65
			case E_DEPRECATED:
66
				return 'E_DEPRECATED';
67

                    
68
			case E_USER_DEPRECATED:
69
				return 'E_USER_DEPRECATED';
70

                    
71
			default:
72
				return strtoupper($error);
73
		}
74
	}
75
}