function DefaultPluginManagerTest::providerTestProcessDefinition

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::providerTestProcessDefinition()
  2. 8.9.x core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::providerTestProcessDefinition()
  3. 10 core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::providerTestProcessDefinition()

File

core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php, line 417

Class

DefaultPluginManagerTest
Tests the DefaultPluginManager.

Namespace

Drupal\Tests\Core\Plugin

Code

public static function providerTestProcessDefinition() {
    $data = [];
    $data['merge'][] = [
        'foo' => [
            'bar' => [
                'asdf',
            ],
        ],
    ];
    $data['merge'][] = [
        'foo' => [
            'bar' => [
                'baz',
                'asdf',
            ],
        ],
    ];
    $object_definition = (object) [
        'foo' => [
            'bar' => [
                'asdf',
            ],
        ],
    ];
    $data['object_definition'] = [
        $object_definition,
        clone $object_definition,
    ];
    $data['no_form'][] = [
        'class' => TestPluginForm::class,
    ];
    $data['no_form'][] = [
        'class' => TestPluginForm::class,
        'foo' => [
            'bar' => [
                'baz',
            ],
        ],
    ];
    $data['default_form'][] = [
        'class' => TestPluginForm::class,
        'forms' => [
            'configure' => 'stdClass',
        ],
    ];
    $data['default_form'][] = [
        'class' => TestPluginForm::class,
        'forms' => [
            'configure' => 'stdClass',
        ],
        'foo' => [
            'bar' => [
                'baz',
            ],
        ],
    ];
    $data['class_with_slashes'][] = [
        'class' => '\\Drupal\\Tests\\Core\\Plugin\\TestPluginForm',
    ];
    $data['class_with_slashes'][] = [
        'class' => 'Drupal\\Tests\\Core\\Plugin\\TestPluginForm',
        'foo' => [
            'bar' => [
                'baz',
            ],
        ],
    ];
    $data['object_with_class_with_slashes'][] = (new PluginDefinition())->setClass('\\Drupal\\Tests\\Core\\Plugin\\TestPluginForm');
    $data['object_with_class_with_slashes'][] = (new PluginDefinition())->setClass('Drupal\\Tests\\Core\\Plugin\\TestPluginForm');
    return $data;
}

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