diff --git a/lib/Drupal/views/Tests/PluginInstanceTest.php b/lib/Drupal/views/Tests/PluginInstanceTest.php index b918772..2e2bc24 100644 --- a/lib/Drupal/views/Tests/PluginInstanceTest.php +++ b/lib/Drupal/views/Tests/PluginInstanceTest.php @@ -8,6 +8,7 @@ namespace Drupal\views\Tests; use ReflectionClass; +use Drupal\views\ViewExecutable; /** * Checks general plugin data and instances for all plugin types. @@ -19,27 +20,7 @@ class PluginInstanceTest extends ViewTestBase { * * @var array */ - protected $pluginTypes = array( - 'access', - 'area', - 'argument', - 'argument_default', - 'argument_validator', - 'cache', - 'display_extender', - 'display', - 'exposed_form', - 'field', - 'filter', - 'join', - 'pager', - 'query', - 'relationship', - 'row', - 'sort', - 'style', - 'wizard', - ); + protected $pluginTypes; /** * An array of plugin definitions, keyed by plugin type. @@ -60,6 +41,7 @@ class PluginInstanceTest extends ViewTestBase { parent::setUp(); $this->definitions = views_get_plugin_definitions(); + $this->pluginTypes = ViewExecutable::getPluginTypes(); } /** @@ -86,7 +68,7 @@ class PluginInstanceTest extends ViewTestBase { * This will iterate through all plugins from _views_fetch_plugin_data(). */ public function testPluginInstances() { - $container = drupal_container(); + $container = drupal_container(NULL, TRUE); foreach ($this->definitions as $type => $plugins) { // Get a plugin manager for this type. $manager = $container->get("plugin.manager.views.$type"); @@ -105,4 +87,45 @@ class PluginInstanceTest extends ViewTestBase { } } + /** + * Tests the views bundle after clearing all caches. + */ + public function testClearCache() { + drupal_flush_all_caches(); + $container = drupal_container(); + foreach ($this->pluginTypes as $type) { + // Get a plugin manager for this type. + $manager = $container->get("plugin.manager.views.$type"); + $this->assertTrue($manager instanceof \Drupal\views\Plugin\Type\PluginManager); + } + } + + /** + * Tests the plugins list is correct. + */ + public function testPluginList() { + $plugin_list = array( + 'access', + 'area', + 'argument', + 'argument_default', + 'argument_validator', + 'cache', + 'display_extender', + 'display', + 'exposed_form', + 'field', + 'filter', + 'join', + 'pager', + 'query', + 'relationship', + 'row', + 'sort', + 'style', + 'wizard', + ); + $diff = array_diff($plugin_list, $this->pluginTypes); + $this->assertTrue(empty($diff), 'The plugin list is correct'); + } }