100% of 74OPs |
92% of 12Lines |
78% of 9Branches |
50% of 4Paths |
| Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
|---|---|---|---|---|---|---|---|---|
| mageekguy\atoum\asserters\castToString::setWith() | 61 | 100% | 11 | 91% | 8 | 75% | 3 | 33% |
| mageekguy\atoum\asserters\castToString::isObject() | 13 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| # | |
|---|---|
| 1 |
<?php |
| 2 |
|
| 3 |
namespace mageekguy\atoum\asserters; |
| 4 |
|
| 5 |
use mageekguy\atoum\asserters; |
| 6 |
|
| 7 |
class castToString extends asserters\phpString |
| 8 |
{
|
| 9 |
public function setWith($value, $charlist = null, $checkType = true)91% |
| 10 |
{
|
| 11 |
parent::setWith($value, $charlist, false); |
| 12 |
|
| 13 |
if ($checkType === true) |
| 14 |
{
|
| 15 |
if (self::isObject($value) === false) |
| 16 |
{
|
| 17 |
$this->fail($this->_('%s is not an object', $this->getTypeOf($value)));
|
| 18 |
} |
| 19 |
else |
| 20 |
{
|
| 21 |
$this->pass(); |
| 22 |
|
| 23 |
$this->value = (string) $this->value; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
return $this; |
| 28 |
} |
| 29 |
|
| 30 |
protected static function isObject($value)100% |
| 31 |
{
|
| 32 |
return (is_object($value) === true); |
| 33 |
} |
| 34 |
} |