/** * Process sizes * * @param string $file File data * @param string $fileName File name * @param string $context File context * @param string $extension File extension * @param FilesystemAdapter $filesystemAdapter * * @return Processor */ public function processSizes($file, $fileName, $context, $extension, FilesystemAdapter $filesystemAdapter) { foreach ($this->config[$context] as $sizeName => $values) { $image = $this->openImageHandler->loadImage($file); $operation = $this->manipulatorFactory->create($values['operation']); $image = $operation->manipulate($image, $values['width'], $values['height']); $this->fileManager->setFileSystemAdapter($filesystemAdapter)->uploadFile($image, $extension, $context, $sizeName, $fileName); } return $this; }
/** * Tests with wrong operation value type */ public function testWithWrongOperationNameValueType() { static::setExpectedExceptionRegExp('LogicException'); $this->factory->create(1000); }