diff --git a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php index 778e9e2..508bd47 100644 --- a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php +++ b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php @@ -11,6 +11,7 @@ use Drupal\system\Annotation\ImageToolkit; use Drupal\Core\Annotation\Translation; use Drupal\Core\Image\ImageInterface; +use Drupal\system\Plugin\ImageToolkitBase; use Drupal\system\Plugin\ImageToolkitInterface; /** @@ -21,7 +22,7 @@ * title = @Translation("A dummy toolkit that works") * ) */ -class TestToolkit extends PluginBase implements ImageToolkitInterface { +class TestToolkit extends ImageToolkitBase implements ImageToolkitInterface { /** * {@inheritdoc} @@ -76,38 +77,6 @@ public function save(ImageInterface $image, $destination) { } /** - * {@inheritdoc} - */ - public function crop(ImageInterface $image, $x, $y, $width, $height) { - $this->logCall('crop', array($image, $x, $y, $width, $height)); - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function resize(ImageInterface $image, $width, $height) { - $this->logCall('resize', array($image, $width, $height)); - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function rotate(ImageInterface $image, $degrees, $background = NULL) { - $this->logCall('rotate', array($image, $degrees, $background)); - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function desaturate(ImageInterface $image) { - $this->logCall('desaturate', array($image)); - return TRUE; - } - - /** * Stores the values passed to a toolkit call. * * @param string $op @@ -119,7 +88,7 @@ public function desaturate(ImageInterface $image) { * @see \Drupal\system\Tests\Image\ToolkitTestBase::imageTestReset() * @see \Drupal\system\Tests\Image\ToolkitTestBase::imageTestGetAllCalls() */ - protected function logCall($op, $args) { + public function logCall($op, $args) { $results = \Drupal::state()->get('image_test.results') ?: array(); $results[$op][] = $args; \Drupal::state()->set('image_test.results', $results); diff --git a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitCrop.php b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitCrop.php new file mode 100644 index 0000000..eaa6643 --- /dev/null +++ b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitCrop.php @@ -0,0 +1,58 @@ +logCall('crop', array($image, $data['x'], $data['y'], $data['width'], $data['height'])); + return TRUE; + } + +} diff --git a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitDesaturate.php b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitDesaturate.php new file mode 100644 index 0000000..a60a3e0 --- /dev/null +++ b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitDesaturate.php @@ -0,0 +1,52 @@ +logCall('desaturate', array($image)); + return TRUE; + } + +} diff --git a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitResize.php b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitResize.php new file mode 100644 index 0000000..9026534 --- /dev/null +++ b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitResize.php @@ -0,0 +1,54 @@ +logCall('resize', array($image, $data['width'], $data['height'])); + return TRUE; + } + +} diff --git a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitRotate.php b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitRotate.php new file mode 100644 index 0000000..7aaf0aa --- /dev/null +++ b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkitOperation/TestToolkitRotate.php @@ -0,0 +1,60 @@ +logCall('rotate', array($image, $data['degrees'], $data['background'])); + return TRUE; + } + +}