function DefaultPluginManagerTest::providerTestProcessDefinition
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Plugin/ DefaultPluginManagerTest.php, line 430  
Class
- DefaultPluginManagerTest
 - Tests the DefaultPluginManager.
 
Namespace
Drupal\Tests\Core\PluginCode
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.