99% of 91OPs |
100% of 12Lines |
71% of 7Branches |
100% of 5Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\asserters\adapter\call\manager::__construct() | 11 | 100% | 2 | 100% | 1 | 0% | 1 | 100% |
mageekguy\atoum\asserters\adapter\call\manager::add() | 13 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\asserters\adapter\call\manager::remove() | 13 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\asserters\adapter\call\manager::check() | 54 | 98% | 6 | 100% | 4 | 75% | 2 | 100% |
# | |
---|---|
1 |
<?php |
2 |
|
3 |
namespace mageekguy\atoum\asserters\adapter\call; |
4 |
|
5 |
use |
6 |
mageekguy\atoum\asserters\adapter |
7 |
; |
8 |
|
9 |
class manager |
10 |
{ |
11 |
protected $calls = null; |
12 |
|
13 |
public function __construct()100% |
14 |
{ |
15 |
$this->calls = new \splObjectStorage(); |
16 |
} |
17 |
|
18 |
public function add(adapter\call $call)100% |
19 |
{ |
20 |
$this->calls->attach($call); |
21 |
|
22 |
return $this; |
23 |
} |
24 |
|
25 |
public function remove(adapter\call $call)100% |
26 |
{ |
27 |
$this->calls->detach($call); |
28 |
|
29 |
return $this; |
30 |
} |
31 |
|
32 |
public function check()100% |
33 |
{ |
34 |
if (sizeof($this->calls) > 0) |
35 |
{ |
36 |
$this->calls->rewind(); |
37 |
|
38 |
$call = $this->calls->current(); |
39 |
|
40 |
throw new manager\exception('Asserter ' . get_class($call) . ' is not evaluated in file \'' . $call->getLastAssertionFile() . '\' on line ' . $call->getLastAssertionLine()); |
41 |
} |
42 |
|
43 |
return $this; |
44 |
} |
45 |
} |