示例#1
0
 public function testRmdir()
 {
     $this->if($directory = testedClass::get())->and($directory->notExists())->then->boolean(rmdir($directory))->isFalse()->if($directory->exists())->then->boolean(rmdir($directory))->isTrue()->if($directory->exists())->and($directory->isNotWritable())->then->boolean(rmdir($directory))->isFalse();
 }
示例#2
0
文件: Package.php 项目: staabm/pickle
 public function testGetRootDir()
 {
     $this->given($name = $this->sample($this->packageName), $version = $this->sample($this->packageVersion), $prettyVersion = $this->sample($this->packagePrettyVersion), $packageRoot = fs\directory::get())->if($this->newTestedInstance($name, $version, $prettyVersion), $this->testedInstance->setRootDir((string) $packageRoot))->then->string($this->testedInstance->getRootDir())->isEqualTo((string) $packageRoot)->if(clearstatcache(), $packageSourceRoot = fs\directory::getSubStream($packageRoot, $this->testedInstance->getPrettyName() . '-' . $this->testedInstance->getPrettyVersion()), $packageSourceRoot->url_stat = ['mode' => 17000])->then->string($this->testedInstance->getRootDir())->isEqualTo((string) $packageRoot);
 }