/** * @test * @group library */ public function setImageFileShouldThrowExceptionOnNonExistingImagefile() { $testFilesDirectory = Registry::getConfig()->test->files->directory; $imageFile = $testFilesDirectory . DIRECTORY_SEPARATOR . 'imageprocessing' . DIRECTORY_SEPARATOR . 'not_existing_file.jpg'; $imageTool = \Seitenbau\Image::factory($this->imageConfig->toArray()); $this->setExpectedException('\\Seitenbau\\Image\\ImageException'); $imageTool->setFile($imageFile); }
protected function setUp() { // Parent aufrufen parent::setUp(); // Konfiguration ermitteln $orgConfig = Registry::getConfig()->imageprocessing; if ($orgConfig instanceof \Zend_Config) { $this->imageConfig = clone $orgConfig; } else { $this->imageConfig = new \Zend_Config(array(), true); } $this->imageConfig->adapter = 'Phpgd'; $this->imageOutputDir = Registry::getConfig()->test->output->imageprocessing->directory; if (!is_dir($this->imageOutputDir)) { mkdir($this->imageOutputDir); } $this->imageTestFileDir = Registry::getConfig()->test->files->directory . DIRECTORY_SEPARATOR . 'imageprocessing'; $this->imageConfig->temp_dir = $this->imageOutputDir; $this->imageConfig->memory_limit = 1048576; $this->imageTypeHandler = \Seitenbau\Image::factory($this->imageConfig->toArray()); }
/** * @return Seitenbau\Image\Image */ protected function getImageAdapter() { $imageAdapterConfig = null; $config = Registry::getConfig(); if (isset($config->screenshot->imageAdapter)) { $imageAdapterConfig = $config->screenshot->imageAdapter; } return ImageTool::factory($imageAdapterConfig); }