protected function ImageEffectsTestBase::changeToolkit in Image Effects 8
Same name and namespace in other branches
- 8.3 tests/src/Functional/ImageEffectsTestBase.php \Drupal\Tests\image_effects\Functional\ImageEffectsTestBase::changeToolkit()
- 8.2 tests/src/Functional/ImageEffectsTestBase.php \Drupal\Tests\image_effects\Functional\ImageEffectsTestBase::changeToolkit()
Change toolkit.
Parameters
string $toolkit_id: The id of the toolkit to set up.
string $toolkit_config: The config object of the toolkit to set up.
array $toolkit_settings: The settings of the toolkit to set up.
25 calls to ImageEffectsTestBase::changeToolkit()
- AspectSwitcherTest::testAspectSwitcherEffect in tests/
src/ Functional/ Effect/ AspectSwitcherTest.php - AspectSwitcher effect test.
- AutoOrientTest::testAutoOrientAllTags in tests/
src/ Functional/ Effect/ AutoOrientTest.php - Auto Orientation effect test, all EXIF orientation tags.
- AutoOrientTest::testAutoOrientEffect in tests/
src/ Functional/ Effect/ AutoOrientTest.php - Auto Orientation effect test.
- BackgroundTest::testBackgroundEffect in tests/
src/ Functional/ Effect/ BackgroundTest.php - Background effect test.
- BrightnessTest::testBrightnessEffect in tests/
src/ Functional/ Effect/ BrightnessTest.php - Brightness effect test.
File
- tests/
src/ Functional/ ImageEffectsTestBase.php, line 208
Class
- ImageEffectsTestBase
- Base test class for image_effects tests.
Namespace
Drupal\Tests\image_effects\FunctionalCode
protected function changeToolkit($toolkit_id, $toolkit_config, array $toolkit_settings) {
\Drupal::configFactory()
->getEditable('system.image')
->set('toolkit', $toolkit_id)
->save();
$config = \Drupal::configFactory()
->getEditable($toolkit_config);
foreach ($toolkit_settings as $setting => $value) {
$config
->set($setting, $value);
}
$config
->save();
// Bots running automated test on d.o. do not have ImageMagick or
// GraphicsMagick binaries installed, so the test will be skipped; they can
// be run locally if binaries are installed.
if ($toolkit_id === 'imagemagick') {
$status = \Drupal::service('image.toolkit.manager')
->createInstance('imagemagick')
->checkPath('');
if (!empty($status['errors'])) {
$this
->markTestSkipped("Tests for '{$toolkit_settings['binaries']}' cannot run because the binaries are not available on the shell path.");
}
}
$this->container
->get('image.factory')
->setToolkitId($toolkit_id);
}