function ImageStylesTest::providerSource

Same name in other branches
  1. 9 core/modules/image/tests/src/Kernel/Plugin/migrate/source/d7/ImageStylesTest.php \Drupal\Tests\image\Kernel\Plugin\migrate\source\d7\ImageStylesTest::providerSource()
  2. 8.9.x core/modules/image/tests/src/Kernel/Plugin/migrate/source/d7/ImageStylesTest.php \Drupal\Tests\image\Kernel\Plugin\migrate\source\d7\ImageStylesTest::providerSource()
  3. 11.x core/modules/image/tests/src/Kernel/Plugin/migrate/source/d7/ImageStylesTest.php \Drupal\Tests\image\Kernel\Plugin\migrate\source\d7\ImageStylesTest::providerSource()

File

core/modules/image/tests/src/Kernel/Plugin/migrate/source/d7/ImageStylesTest.php, line 28

Class

ImageStylesTest
Tests the D7 ImageStyles source plugin.

Namespace

Drupal\Tests\image\Kernel\Plugin\migrate\source\d7

Code

public static function providerSource() {
    $tests = [];
    // The source data.
    $tests[0]['source_data']['image_styles'] = [
        [
            'isid' => 1,
            'name' => 'custom_image_style_1',
            'label' => 'Custom image style 1',
        ],
    ];
    $tests[0]['source_data']['image_effects'] = [
        [
            'ieid' => 1,
            'isid' => 1,
            'weight' => 1,
            'name' => 'image_desaturate',
            'data' => serialize([]),
        ],
    ];
    // The expected results.
    $tests[0]['expected_data'] = [
        [
            'isid' => 1,
            'name' => 'custom_image_style_1',
            'label' => 'Custom image style 1',
            'effects' => [
                [
                    'ieid' => 1,
                    'isid' => 1,
                    'weight' => 1,
                    'name' => 'image_desaturate',
                    'data' => [],
                ],
            ],
        ],
    ];
    return $tests;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.