/** * Loads the binary file with $binaryFileId * @throws \eZ\Publish\Core\Base\Exceptions\NotFoundException If no file identified by $binaryFileId exists * @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue If $binaryFileId is invalid * @param string $binaryFileId * @return BinaryFile|bool the file, or false if it doesn't exist */ public function loadBinaryFile($binaryFileId) { if (empty($binaryFileId) || !is_string($binaryFileId)) { throw new InvalidArgumentValue("binaryFileId", $binaryFileId); } // @todo An absolute path can in no case be loaded, but throwing an exception is a bit too much at this stage if ($binaryFileId[0] === '/') { return false; } return $this->buildDomainBinaryFileObject($this->ioHandler->load($this->getPrefixedUri($binaryFileId))); }
/** * @covers \eZ\Publish\Core\IO\Handler::load * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException */ public function testLoadNonExistingFile() { $this->IOHandler->load('images/loadNotFound.png'); }