/** * @param string $filename */ public function setFilename($filename) { Assertion::string($filename, 'Invalid filename.'); Assertion::directory(dirname($filename), 'The selected directory does not exist.'); Assertion::writeable(dirname($filename), 'The selected directory is not writable.'); $this->filename = $filename; }
public function __construct($directory) { Assertion::directory($directory); Assertion::readable($directory); $directory .= substr($directory, -1) === '/' ? '' : '/'; //add ending slash $this->directory = $directory; }
public function testDirectory() { Assertion::directory(__DIR__); $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_DIRECTORY); Assertion::directory(__DIR__ . '/does-not-exist'); }
/** * Sets the project directory. * * @param string $projectDirectory * * @return $this */ public function setProjectDirectory($projectDirectory) { Assertion::directory($projectDirectory); $this->projectDirectory = $projectDirectory; return $this; }
/** * __construct() * * @param ConfigLoader $configLoader Config loader * @param string $path Config files path */ public function __construct(ConfigLoader $configLoader, $path) { Assertion::directory($path); $this->path = $path; $this->configLoader = $configLoader; }
/** * @Given /^I specify the path "([^"]*)"$/ */ public function iSpecifyThePath($arg1) { $this->path = $arg1; Assertion::directory(getcwd() . '/' . $this->path); }