82% of 193OPs |
78% of 32Lines |
65% of 34Branches |
7% of 138Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\report\fields\runner\result::getTestNumber() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\result::getTestMethodNumber() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\result::getAssertionNumber() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\result::getFailNumber() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\result::getErrorNumber() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\result::getExceptionNumber() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\result::getVoidMethodNumber() | 6 | 0% | 1 | 0% | 1 | 0% | 1 | 0% |
mageekguy\atoum\report\fields\runner\result::getUncompletedMethodNumber() | 6 | 0% | 1 | 0% | 1 | 0% | 1 | 0% |
mageekguy\atoum\report\fields\runner\result::getSkippedMethodNumber() | 6 | 0% | 1 | 0% | 1 | 0% | 1 | 0% |
mageekguy\atoum\report\fields\runner\result::handleEvent() | 139 | 88% | 23 | 83% | 25 | 64% | 129 | 2% |
# | |
---|---|
1 |
<?php |
2 |
|
3 |
namespace mageekguy\atoum\report\fields\runner; |
4 |
|
5 |
use |
6 |
mageekguy\atoum\runner, |
7 |
mageekguy\atoum\report, |
8 |
mageekguy\atoum\observable |
9 |
; |
10 |
|
11 |
abstract class result extends report\field |
12 |
{ |
13 |
protected $success = false; |
14 |
protected $testNumber = null; |
15 |
protected $testMethodNumber = null; |
16 |
protected $assertionNumber = null; |
17 |
protected $failNumber = null; |
18 |
protected $errorNumber = null; |
19 |
protected $exceptionNumber = null; |
20 |
protected $voidMethodNumber = null; |
21 |
protected $uncompletedMethodNumber = null; |
22 |
protected $skippedMethodNumber = null; |
23 |
|
24 |
public function __construct() |
25 |
{ |
26 |
parent::__construct(array(runner::runStop)); |
27 |
} |
28 |
|
29 |
public function getTestNumber()100% |
30 |
{ |
31 |
return $this->testNumber; |
32 |
} |
33 |
|
34 |
public function getTestMethodNumber()100% |
35 |
{ |
36 |
return $this->testMethodNumber; |
37 |
} |
38 |
|
39 |
public function getAssertionNumber()100% |
40 |
{ |
41 |
return $this->assertionNumber; |
42 |
} |
43 |
|
44 |
public function getFailNumber()100% |
45 |
{ |
46 |
return $this->failNumber; |
47 |
} |
48 |
|
49 |
public function getErrorNumber()100% |
50 |
{ |
51 |
return $this->errorNumber; |
52 |
} |
53 |
|
54 |
public function getExceptionNumber()100% |
55 |
{ |
56 |
return $this->exceptionNumber; |
57 |
} |
58 |
|
59 |
public function getVoidMethodNumber()0% |
60 |
{ |
61 |
return $this->voidMethodNumber; |
62 |
} |
63 |
|
64 |
public function getUncompletedMethodNumber()0% |
65 |
{ |
66 |
return $this->uncompletedMethodNumber; |
67 |
} |
68 |
|
69 |
public function getSkippedMethodNumber()0% |
70 |
{ |
71 |
return $this->skippedMethodNumber; |
72 |
} |
73 |
|
74 |
public function handleEvent($event, observable $observable)83% |
75 |
{ |
76 |
if (parent::handleEvent($event, $observable) === false) |
77 |
{ |
78 |
return false; |
79 |
} |
80 |
else |
81 |
{ |
82 |
$score = $observable->getScore(); |
83 |
|
84 |
$this->testNumber = $observable->getTestNumber(); |
85 |
$this->testMethodNumber = $observable->getTestMethodNumber(); |
86 |
$this->assertionNumber = $score->getAssertionNumber(); |
87 |
$this->failNumber = $score->getFailNumber(); |
88 |
$this->errorNumber = $score->getErrorNumber(); |
89 |
$this->exceptionNumber = $score->getExceptionNumber(); |
90 |
$this->voidMethodNumber = $score->getVoidMethodNumber(); |
91 |
$this->uncompletedMethodNumber = $score->getUncompletedMethodNumber(); |
92 |
$this->skippedMethodNumber = $score->getSkippedMethodNumber(); |
93 |
$this->success = ($this->failNumber === 0 && $this->errorNumber === 0 && $this->exceptionNumber === 0 && $this->uncompletedMethodNumber === 0); |
94 |
|
95 |
if ($observable->shouldFailIfVoidMethods() && $this->voidMethodNumber > 0) |
96 |
{ |
97 |
$this->success = false; |
98 |
} |
99 |
|
100 |
if ($observable->shouldFailIfSkippedMethods() && $this->skippedMethodNumber > 0) |
101 |
{ |
102 |
$this->success = false; |
103 |
} |
104 |
|
105 |
return true; |
106 |
} |
107 |
} |
108 |
} |