public function testDefaultPluginManagerWithPluginExtendingNonInstalledClass() { $definitions =
[];
$definitions['extending_non_installed_class'
] =
[ 'id' => 'extending_non_installed_class',
'label' => 'A plugin whose class is extending from a non-installed module class',
'color' => 'pink',
'class' => 'Drupal\plugin_test\Plugin\plugin_test\fruit\ExtendingNonInstalledClass',
'provider' => 'plugin_test',
];
$module_handler =
$this->
createMock('Drupal\Core\Extension\ModuleHandlerInterface'
);
$plugin_manager =
new TestPluginManager($this->namespaces,
$definitions,
$module_handler, 'test_alter_hook', '\Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface'
);
$plugin_manager->
getDefinition('plugin_test', FALSE
);
$this->
assertTrue(TRUE, 'No PHP fatal error occurred when retrieving the definitions of a module with plugins that depend on a non-installed module class should not cause a PHP fatal.'
);
} /**
* Tests the plugin manager with a disabled module.
*/
public function testDefaultPluginManagerWithDisabledModule() { $definitions =
$this->expectedDefinitions;
$definitions['cherry'
] =
[ 'id' => 'cherry',