Commit 137e2760 authored by Steven Jones's avatar Steven Jones Committed by Steven Jones
Browse files

Issue #2829539 by Steven Jones: Add pipeline unit tests

parent 691957f7
......@@ -7,60 +7,59 @@ processors:
ad260c90-e845-452d-b5dd-d20d9db687fe:
uuid: ad260c90-e845-452d-b5dd-d20d9db687fe
id: advdef
weight: '1'
weight: 1
data:
manual_executable_path: ''
recompress: 0
mode: '3'
recompress: false
mode: 3
0a8a85c1-2ccc-4cde-844c-97a7588f006c:
uuid: 0a8a85c1-2ccc-4cde-844c-97a7588f006c
id: advdpng
weight: '2'
id: advpng
weight: 2
data:
manual_executable_path: ''
recompress: 0
mode: '3'
recompress: false
mode: 3
2987bbcc-6a38-4c82-a9f5-86df39c67935:
uuid: 2987bbcc-6a38-4c82-a9f5-86df39c67935
id: jfifremove
weight: '3'
weight: 3
data:
manual_executable_path: ''
2c1a727a-d7d5-4355-842a-519554d46647:
uuid: 2c1a727a-d7d5-4355-842a-519554d46647
id: jpegoptim
weight: '4'
weight: 4
data:
manual_executable_path: ''
progressive: ''
quality: ''
size: ''
progressive:
quality:
size:
74c9f4a7-e5c8-4ddd-8698-4d940f73fea9:
uuid: 74c9f4a7-e5c8-4ddd-8698-4d940f73fea9
id: jpegtran
weight: '5'
weight: 5
data:
manual_executable_path: ''
progressive: 0
progressive: false
fb380dd6-14f0-4b5f-8615-1ed40147ae17:
uuid: fb380dd6-14f0-4b5f-8615-1ed40147ae17
id: optipng
weight: '6'
weight: 6
data:
manual_executable_path: ''
level: 5
interlace: ''
progressive: null
interlace:
f1390b39-5a83-46a5-ba88-4f671ee0e941:
uuid: f1390b39-5a83-46a5-ba88-4f671ee0e941
id: pngcrush
weight: '7'
weight: 7
data:
manual_executable_path: ''
f8156232-0825-4655-9d53-5333120387df:
uuid: f8156232-0825-4655-9d53-5333120387df
id: pngout
weight: '8'
weight: 8
data:
manual_executable_path: ''
7645ce49-49f7-4a53-a781-4c7929e7d11c:
......
......@@ -7,6 +7,6 @@ processors:
b160a7b4-debf-494c-89e6-049a7f787859:
uuid: b160a7b4-debf-494c-89e6-049a7f787859
id: resmushit
weight: '1'
weight: 1
data:
quality: ''
quality:
......@@ -27,6 +27,106 @@ imageapi_optimize.processor.*:
type: mapping
label: 'Processor settings'
imageapi_optimize.processor.advdef:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
recompress:
label: 'Recompress'
type: boolean
mode:
label: 'Compression mode'
type: integer
imageapi_optimize.processor.advpng:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
recompress:
label: 'Recompress'
type: boolean
mode:
label: 'Compression mode'
type: integer
imageapi_optimize.processor.jfifremove:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
imageapi_optimize.processor.jpegoptim:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
progressive:
label: 'Progressive'
type: boolean
quality:
label: 'Quality'
type: integer
size:
label: 'Target file size'
type: integer
imageapi_optimize.processor.jpegtran:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
progressive:
label: 'Progressive'
type: boolean
imageapi_optimize.processor.optipng:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
interlace:
label: 'Interlace'
type: boolean
level:
label: 'Optimization level'
type: integer
imageapi_optimize.processor.pngcrush:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
imageapi_optimize.processor.pngout:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
imageapi_optimize.processor.pngquant:
type: mapping
mapping:
manual_executable_path:
label: 'Binary executable path'
type: string
imageapi_optimize.processor.resmushit:
type: mapping
mapping:
quality:
label: 'Quality'
type: integer
imageapi_optimize.settings:
type: config_object
mapping:
......
......@@ -44,7 +44,7 @@ class ImageStyleWithPipeline extends ImageStyle {
else {
$pipelineId = $this->pipeline;
}
if ($pipeline = $storage->load($pipelineId)) {
if (!empty($pipelineId) && ($pipeline = $storage->load($pipelineId))) {
return $pipeline;
}
}
......
......@@ -9,7 +9,7 @@ use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase;
* Uses the AdvPng binary to optimize images.
*
* @ImageAPIOptimizeProcessor(
* id = "advdpng",
* id = "advpng",
* label = @Translation("AdvPng"),
* description = @Translation("Uses the AdvPng binary to optimize images.")
* )
......
......@@ -85,7 +85,7 @@ class JpegOptim extends ImageAPIOptimizeProcessorBinaryBase {
1 => t('Progressive'),
),
'#default_value' => $this->configuration['progressive'],
'#description' => t('If "No change" is select, the output will have the same as the input.'),
'#description' => t('If "No change" is selected, the output will have the same as the input.'),
);
$form['quality'] = array(
......
......@@ -88,6 +88,7 @@ class OptiPng extends ImageAPIOptimizeProcessorBinaryBase {
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::submitConfigurationForm($form, $form_state);
$this->configuration['progressive'] = $form_state->getValue('progressive');
$this->configuration['level'] = $form_state->getValue('level');
$this->configuration['interlace'] = $form_state->getValue('interlace');
}
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class FileMoveTest extends \Drupal\image\Tests\FileMoveTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageAdminStylesTest extends \Drupal\image\Tests\ImageAdminStylesTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageDimensionsTest extends \Drupal\image\Tests\ImageDimensionsTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageEffectsTest extends \Drupal\image\Tests\ImageEffectsTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageFieldDefaultImagesTest extends \Drupal\image\Tests\ImageFieldDefaultImagesTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageFieldDisplayTest extends \Drupal\image\Tests\ImageFieldDisplayTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageFieldValidateTest extends \Drupal\image\Tests\ImageFieldValidateTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageFieldWidgetTest extends \Drupal\image\Tests\ImageFieldWidgetTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageOnTranslatedEntityTest extends \Drupal\image\Tests\ImageOnTranslatedEntityTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageStyleDeleteTest extends \Drupal\image\Tests\ImageStyleDeleteTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageStyleFlushTest extends \Drupal\image\Tests\ImageStyleFlushTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageStylesPathAndUrlTest extends \Drupal\image\Tests\ImageStylesPathAndUrlTest {
public static $modules = array('imageapi_optimize',);
}
<?php
namespace Drupal\imageapi_optimize\Tests;
/**
* Tests creation, deletion, and editing of image styles and effects.
*
* @group image
*/
class ImageThemeFunctionTest extends \Drupal\image\Tests\ImageThemeFunctionTest {
public static $modules = array('imageapi_optimize',);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment