mageekguy\atoum\mock\streams\fs\directory\controller::rmdir PHP Method

rmdir() public method

public rmdir ( $path, $options )
    public function rmdir($path, $options)
    {
        if ($this->exists === false || $this->checkIfWritable() === false) {
            return false;
        } else {
            $this->exists = false;
            return true;
        }
    }

Usage Example

Exemplo n.º 1
0
 public function testRmdir()
 {
     $this->if($controller = new testedClass(uniqid()))->and($controller->exists())->then->boolean($controller->rmdir(uniqid(), STREAM_MKDIR_RECURSIVE))->isTrue()->variable($controller->getPermissions())->isNull()->if($controller->exists())->and($controller->isNotWritable())->then->boolean($controller->rmdir(uniqid(), STREAM_MKDIR_RECURSIVE))->isFalse()->integer($controller->getPermissions())->isNotNull()->if($controller->notExists())->then->boolean($controller->rmdir(uniqid(), STREAM_MKDIR_RECURSIVE))->isFalse()->variable($controller->getPermissions())->isNull();
 }