Skip to content
Permalink
Browse files

Increase Darkroom class tests

  • Loading branch information...
bastianallgeier committed Jun 24, 2019
1 parent 73e18a3 commit 24d76bdb2ce03851e4b9f3cddee1e7d38eb04726
Showing with 32 additions and 0 deletions.
  1. +32 −0 tests/Image/DarkroomTest.php
@@ -11,6 +11,25 @@ public function file()
return __DIR__ . '/fixtures/image/cat.jpg';
}
public function testFactory()
{
$instance = Darkroom::factory('gd');
$this->assertInstanceOf(Darkroom\GdLib::class, $instance);
$instance = Darkroom::factory('im');
$this->assertInstanceOf(Darkroom\ImageMagick::class, $instance);
}
public function testFactoryWithInvalidType()
{
$this->expectException('Exception');
$this->expectExceptionMessage('Invalid Darkroom type');
$instance = Darkroom::factory('does-not-exist');
}
public function testCropWithoutPosition()
{
$darkroom = new Darkroom();
@@ -79,4 +98,17 @@ public function testPassedOptions()
$this->assertEquals(30, $options['quality']);
}
public function testProcess()
{
$darkroom = new Darkroom([
'quality' => 20
]);
$options = $darkroom->process($this->file(), [
'quality' => 30
]);
$this->assertEquals(30, $options['quality']);
}
}

0 comments on commit 24d76bd

Please sign in to comment.
You can’t perform that action at this time.