$this->
assertSame(['mapping_test', 'test_style', 'test_template_style'
],
array_keys($plugins));
// Test a non existent style plugin type returns no plugins.
$plugins = Views::
fetchPluginNames('style',
$this->
randomString());
$this->
assertSame([],
$plugins);
} /**
* Tests the \Drupal\views\Views::pluginList() method.
*/
public function testViewsPluginList() { $plugin_list = Views::
pluginList();
// Only plugins used by 'test_view' should be in the plugin list.
foreach (['display:default', 'pager:none'
] as $key) { [$plugin_type,
$plugin_id] =
explode(':',
$key);
$plugin_def =
$this->container->
get("plugin.manager.views.
$plugin_type"
)->
getDefinition($plugin_id);
$this->
assertTrue(isset($plugin_list[$key]),
new FormattableMarkup('The expected @key plugin list key was found.',
['@key' =>
$key]));
$plugin_details =
$plugin_list[$key];
$this->
assertEquals($plugin_type,
$plugin_details['type'
], 'The expected plugin type was found.'
);
$this->
assertEquals($plugin_def['title'
],
$plugin_details['title'
], 'The expected plugin title was found.'
);
$this->
assertEquals($plugin_def['provider'
],
$plugin_details['provider'
], 'The expected plugin provider was found.'
);