/** * @test * @expectedException RuntimeException */ public function throwRuntimeExceptionOnWriteIfPathIsNotWritable() { $this->touchUnwritableFile(); FileValidator::canWrite($this->unwritablePath, $this->throwException); }
/** * Return whether the file is writable. * * @return boolean true if the file is writable. * @throws \RuntimeException Throw if the file is not writable and $throwException is set to true. */ public function isWritable() { return FileValidator::canWrite($this->path, $this->throwException); }