98% of 112OPs |
100% of 17Lines |
81% of 16Branches |
91% of 11Paths |
| Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
|---|---|---|---|---|---|---|---|---|
| mageekguy\atoum\mock\streams\fs\directory\controller::__construct() | 17 | 100% | 3 | 100% | 1 | 0% | 1 | 100% |
| mageekguy\atoum\mock\streams\fs\directory\controller::setPermissions() | 18 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\mock\streams\fs\directory\controller::getContents() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\mock\streams\fs\directory\controller::mkdir() | 28 | 96% | 5 | 100% | 4 | 75% | 2 | 100% |
| mageekguy\atoum\mock\streams\fs\directory\controller::rmdir() | 29 | 97% | 5 | 100% | 7 | 86% | 4 | 75% |
| mageekguy\atoum\mock\streams\fs\directory\controller::dir_opendir() | 8 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\mock\streams\fs\directory\controller::dir_closedir() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| # | |
|---|---|
| 1 |
<?php |
| 2 |
|
| 3 |
namespace mageekguy\atoum\mock\streams\fs\directory; |
| 4 |
|
| 5 |
use |
| 6 |
mageekguy\atoum\exceptions, |
| 7 |
mageekguy\atoum\mock\streams\fs |
| 8 |
; |
| 9 |
|
| 10 |
class controller extends fs\controller |
| 11 |
{
|
| 12 |
public function __construct($path)100% |
| 13 |
{
|
| 14 |
parent::__construct($path); |
| 15 |
|
| 16 |
$this->setPermissions('755');
|
| 17 |
} |
| 18 |
|
| 19 |
public function setPermissions($permissions)100% |
| 20 |
{
|
| 21 |
return parent::setPermissions(0400000 | octdec($permissions)); |
| 22 |
} |
| 23 |
|
| 24 |
public function getContents()100% |
| 25 |
{
|
| 26 |
return array(); |
| 27 |
} |
| 28 |
|
| 29 |
public function mkdir($path, $mode, $options)100% |
| 30 |
{
|
| 31 |
if ($this->exists === true) |
| 32 |
{
|
| 33 |
return false; |
| 34 |
} |
| 35 |
else |
| 36 |
{
|
| 37 |
$this->setPermissions($mode)->exists = true; |
| 38 |
|
| 39 |
return true; |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
public function rmdir($path, $options)100% |
| 44 |
{
|
| 45 |
if ($this->exists === false || $this->checkIfWritable() === false) |
| 46 |
{
|
| 47 |
return false; |
| 48 |
} |
| 49 |
else |
| 50 |
{
|
| 51 |
$this->exists = false; |
| 52 |
|
| 53 |
return true; |
| 54 |
} |
| 55 |
} |
| 56 |
|
| 57 |
public function dir_opendir($path, $useSafeMode)100% |
| 58 |
{
|
| 59 |
return $this->exists; |
| 60 |
} |
| 61 |
|
| 62 |
public function dir_closedir()100% |
| 63 |
{
|
| 64 |
return $this->exists; |
| 65 |
} |
| 66 |
} |