mageekguy\atoum\report\field: lines coverage

79% of 73

OPs

90% of 10

Lines

60% of 10

Branches

71% of 7

Paths
Method OPs OPs % Lines Line % Branches Branches % Paths Path %
mageekguy\atoum\report\field::__construct() 12 100% 3 100% 1 0% 1 100%
mageekguy\atoum\report\field::setLocale() 16 100% 2 100% 1 100% 1 100%
mageekguy\atoum\report\field::getLocale() 6 100% 1 100% 1 100% 1 100%
mageekguy\atoum\report\field::getEvents() 6 100% 1 100% 1 100% 1 100%
mageekguy\atoum\report\field::canHandleEvent() 21 86% 1 100% 5 60% 2 50%
mageekguy\atoum\report\field::handleEvent() 12 0% 2 50% 1 0% 1 0%
#
1
<?php
2

                    
3
namespace mageekguy\atoum\report;
4

                    
5
use
6
	mageekguy\atoum
7
;
8

                    
9
abstract class field
10
{
11
	protected $events = array();
12
	protected $locale = null;
13

                    
14
	public function __construct(array $events = null)100%
15
	{
16
		$this->events = $events;
17

                    
18
		$this->setLocale();
19
	}
20

                    
21
	public function setLocale(atoum\locale $locale = null)100%
22
	{
23
		$this->locale = $locale ?: new atoum\locale();
24

                    
25
		return $this;
26
	}
27

                    
28
	public function getLocale()100%
29
	{
30
		return $this->locale;
31
	}
32

                    
33
	public function getEvents()100%
34
	{
35
		return $this->events;
36
	}
37

                    
38
	public function canHandleEvent($event)100%
39
	{
40
		return ($this->events === null ? true : in_array($event, $this->events));
41
	}
42

                    
43
	public function handleEvent($event, atoum\observable $observable)50%
44
	{
45
		return $this->canHandleEvent($event);
46
	}
47

                    
48
	abstract public function __toString();
49
}