private function validateSaveParams($type, $files) { # Validate paths and make sure filename index always exists foreach ($files as $rendition => $file) { if (!file_exists($file['file'])) { throw new binarypool_exception(103, 404, "File to save in binary pool does not exist: " . $file['file']); } binarypool_validate::validate($type, $this->bucketName, $file['file']); } }
/** * Tests validation of MIME types for an image file. */ function testValidateIMAGEOkay() { $file = realpath(dirname(__FILE__) . '/../res/vw_golf.jpg'); $this->assertIdentical(binarypool_validate::validate('IMAGE', 'test_image_validation', $file), true); }