예제 #1
0
 public function process(File $file, array $operations) : ImageInterface
 {
     $image = $this->imagine->read($file->getStream());
     foreach ($operations as $operation => $args) {
         $this->executeOperation($image, $operation, $args);
     }
     return $image;
 }
예제 #2
0
 public function it_will_error_on_invalid_operation(File $file, ImageInterface $image)
 {
     $stream = tmpfile();
     $file->getStream()->willReturn($stream);
     $this->imagine->read($stream)->willReturn($image);
     $this->shouldThrow(\RuntimeException::class)->duringProcess($file, ['nope' => []]);
     $this->shouldThrow(\RuntimeException::class)->duringProcess($file, ['resize' => []]);
 }