You are here

protected function FeaturesUserTestCase::_test_image in Features 7.2

Same name and namespace in other branches
  1. 7 tests/features.test \FeaturesUserTestCase::_test_image()

Loads or saves an example image style for testing.

Parameters

string $op: One of 'load' or 'override'.

Return value

array|false|void If $op === 'load': The 'features_test' image style, or FALSE if it does not exist. If $op === 'override': No return value (null/void). The 'features_test' image style will be modified, changing one of the effects.

File

tests/features.test, line 184
Contains test classes for features module.

Class

FeaturesUserTestCase
User permission component tests for Features.

Code

protected function _test_image($op = 'load') {
  switch ($op) {
    case 'load':
      return image_style_load('features_test');
    case 'override':
      $style = image_style_load('features_test');
      $style = image_style_save($style);
      foreach ($style['effects'] as $effect) {
        $effect['data']['width'] = '120';
        image_effect_save($effect);
      }
      break;
  }
}