78% of 79OPs |
79% of 14Lines |
40% of 10Branches |
83% of 6Paths |
| Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
|---|---|---|---|---|---|---|---|---|
| mageekguy\atoum\mock\controller\invoker::__construct() | 15 | 100% | 3 | 100% | 1 | 0% | 1 | 100% |
| mageekguy\atoum\mock\controller\invoker::__get() | 35 | 51% | 6 | 50% | 6 | 17% | 2 | 50% |
| mageekguy\atoum\mock\controller\invoker::setMock() | 9 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\mock\controller\invoker::getMock() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\mock\controller\invoker::isFluent() | 14 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
| # | |
|---|---|
| 1 |
<?php |
| 2 |
|
| 3 |
namespace mageekguy\atoum\mock\controller; |
| 4 |
|
| 5 |
use |
| 6 |
mageekguy\atoum\mock, |
| 7 |
mageekguy\atoum\test\adapter |
| 8 |
; |
| 9 |
|
| 10 |
class invoker extends adapter\invoker |
| 11 |
{
|
| 12 |
protected $mock = null; |
| 13 |
|
| 14 |
public function __construct($method, mock\aggregator $mock = null)100% |
| 15 |
{
|
| 16 |
parent::__construct($method); |
| 17 |
|
| 18 |
$this->mock = $mock; |
| 19 |
} |
| 20 |
|
| 21 |
public function __get($property)50% |
| 22 |
{
|
| 23 |
switch (strtolower($property)) |
| 24 |
{
|
| 25 |
case 'isfluent': |
| 26 |
return $this->isFluent(); |
| 27 |
|
| 28 |
default: |
| 29 |
return parent::__get($property); |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
public function setMock(mock\aggregator $mock)100% |
| 34 |
{
|
| 35 |
$this->mock = $mock; |
| 36 |
|
| 37 |
return $this; |
| 38 |
} |
| 39 |
|
| 40 |
public function getMock()100% |
| 41 |
{
|
| 42 |
return $this->mock; |
| 43 |
} |
| 44 |
|
| 45 |
public function isFluent()100% |
| 46 |
{
|
| 47 |
$mock = $this->mock; |
| 48 |
|
| 49 |
return $this->setClosure(function() use ($mock) { return $mock; });
|
| 50 |
} |
| 51 |
} |