/** * Returns the content of the binary file * * @param \eZ\Publish\Core\IO\Values\BinaryFile $binaryFile * * @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue * @return string */ public function getFileContents(BinaryFile $binaryFile) { if (empty($binaryFile->id) || !is_string($binaryFile->id)) { throw new InvalidArgumentValue("binaryFileId", $binaryFile->id, "BinaryFile"); } return $this->ioHandler->getFileContents($this->getPrefixedUri($binaryFile->id)); }
/** * @covers \eZ\Publish\Core\IO\Handler::getFileContents * @expectedException \eZ\Publish\Core\Base\Exceptions\NotFoundException */ public function testGetFileContentsNonExistingFile() { $this->IOHandler->getFileContents('testGetFileContentsNonExistingFile.gif'); }