diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php index 77393d6536f..8738aa49877 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php @@ -56,7 +56,7 @@ class IntegrationTest extends ViewUnitTestBase { $this->installSchema('aggregator', array('aggregator_item', 'aggregator_feed', 'aggregator_category_feed', 'aggregator_category', 'aggregator_category_item')); - ViewTestData::importTestViews(get_class($this), array('aggregator_test_views')); + ViewTestData::createTestViews(get_class($this), array('aggregator_test_views')); $this->itemStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_item'); $this->feedStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_feed'); diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index 1e075868e29..463bcd523b1 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -43,7 +43,7 @@ class DisplayBlockTest extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('block_test_views')); + ViewTestData::createTestViews(get_class($this), array('block_test_views')); $this->enableViewsTestModule(); } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php index 7027ef46d81..adba6b82620 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php @@ -32,7 +32,7 @@ abstract class CommentTestBase extends ViewTestBase { function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('comment_test_views')); + ViewTestData::createTestViews(get_class($this), array('comment_test_views')); // Add two users, create a node with the user1 as author and another node // with user2 as author. For the second node add a comment from user1. diff --git a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php index c2f6a214eac..064ac2d782a 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php @@ -52,7 +52,7 @@ class ContactLinkTest extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('contact_test_views')); + ViewTestData::createTestViews(get_class($this), array('contact_test_views')); $this->userData = $this->container->get('user.data'); } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php index b26b0a58ba4..fe453792412 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php @@ -51,7 +51,7 @@ class TranslationLinkTest extends ContentTranslationTestBase { $user->langcode = 'en'; $user->save(); - ViewTestData::importTestViews(get_class($this), array('content_translation_test_views')); + ViewTestData::createTestViews(get_class($this), array('content_translation_test_views')); } /** diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php index d5484807611..dce1106022a 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php +++ b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php @@ -48,7 +48,7 @@ class ViewsIntegrationTest extends ViewUnitTestBase { $this->enableModules(array('system', 'dblog')); $this->installSchema('dblog', array('watchdog')); - ViewTestData::importTestViews(get_class($this), array('dblog_test_views')); + ViewTestData::createTestViews(get_class($this), array('dblog_test_views')); } /** diff --git a/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php b/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php index 2f8e5a6f15f..947ec8746f0 100644 --- a/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php +++ b/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php @@ -51,7 +51,7 @@ abstract class FieldTestBase extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('field_test_views')); + ViewTestData::createTestViews(get_class($this), array('field_test_views')); } function setUpFields($amount = 3) { diff --git a/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php b/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php index 3406a6bb662..87ab5f89c10 100644 --- a/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php @@ -40,7 +40,7 @@ class ExtensionViewsFieldTest extends ViewUnitTestBase { */ protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('file_test_views')); + ViewTestData::createTestViews(get_class($this), array('file_test_views')); } /** diff --git a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php index 2a04b4c1b88..48552aff756 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php @@ -40,7 +40,7 @@ class ForumIntegrationTest extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('forum_test_views')); + ViewTestData::createTestViews(get_class($this), array('forum_test_views')); } diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php b/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php index d30f5285812..1c634bbfc12 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php @@ -25,7 +25,7 @@ abstract class NodeTestBase extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('node_test_views')); + ViewTestData::createTestViews(get_class($this), array('node_test_views')); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php index edb40d0d146..4e440691f1f 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php @@ -24,7 +24,7 @@ class RevisionRelationships extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('node_test_views')); + ViewTestData::createTestViews(get_class($this), array('node_test_views')); } /** diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php index dcc4ac67891..6594cfdfce8 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php @@ -50,7 +50,7 @@ class StyleSerializerTest extends PluginTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('rest_test_views')); + ViewTestData::createTestViews(get_class($this), array('rest_test_views')); $this->adminUser = $this->drupalCreateUser(array('administer views', 'administer entity_test content', 'access user profiles', 'view test entity')); diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php index a16f824b71d..fd447d15e2f 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php @@ -57,7 +57,7 @@ class IntegrationTest extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('statistics_test_views')); + ViewTestData::createTestViews(get_class($this), array('statistics_test_views')); // Create a new user for viewing nodes. $this->webUser = $this->drupalCreateUser(array('access content')); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php index 17c88293e57..b95759d37b1 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php @@ -45,7 +45,7 @@ class TaxonomyIndexTidUiTest extends UITestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('taxonomy_test_views')); + ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views')); } /** diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php index 6e5e7ff7c4d..3209d33a7f7 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php @@ -48,7 +48,7 @@ abstract class TaxonomyTestBase extends ViewTestBase { parent::setUp(); $this->mockStandardInstall(); - ViewTestData::importTestViews(get_class($this), array('taxonomy_test_views')); + ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views')); $this->term1 = $this->createTerm(); $this->term2 = $this->createTerm(); diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php b/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php index 1ae4ba6f507..2b2ffc7e450 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php +++ b/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php @@ -26,7 +26,7 @@ abstract class TrackerTestBase extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('tracker_test_views')); + ViewTestData::createTestViews(get_class($this), array('tracker_test_views')); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php index 59107267b0b..91c45efdf35 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php @@ -65,7 +65,7 @@ class HandlerFilterUserNameTest extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('user_test_views')); + ViewTestData::createTestViews(get_class($this), array('user_test_views')); $this->enableViewsTestModule(); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php index 88b1c78070b..0b4df3d1c73 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php @@ -39,7 +39,7 @@ abstract class UserTestBase extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('user_test_views')); + ViewTestData::createTestViews(get_class($this), array('user_test_views')); $this->users[] = $this->drupalCreateUser(); $this->users[] = user_load(1); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php index 9446f66d2bb..bec7c5a7e44 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php @@ -46,7 +46,7 @@ abstract class UserUnitTestBase extends ViewUnitTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('user_test_views')); + ViewTestData::createTestViews(get_class($this), array('user_test_views')); $this->installSchema('user', array('users', 'users_roles')); $this->installSchema('system', 'sequences'); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php index 09eaaf82540..b86ca2893d2 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php @@ -37,7 +37,7 @@ class AccessTest extends PluginTestBase { $this->enableViewsTestModule(); - ViewTestData::importTestViews(get_class($this), array('views_test_data')); + ViewTestData::createTestViews(get_class($this), array('views_test_data')); $this->admin_user = $this->drupalCreateUser(array('access all views')); $this->web_user = $this->drupalCreateUser(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php index f1a05635989..bd5f2525c9a 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php @@ -45,7 +45,7 @@ class ViewsBlockTest extends ViewUnitTestBase { protected function setUp() { parent::setUp(); - ViewTestData::importTestViews(get_class($this), array('block_test_views')); + ViewTestData::createTestViews(get_class($this), array('block_test_views')); } /** diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php b/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php index 67e84a6e988..db703fe93fc 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php @@ -38,7 +38,7 @@ abstract class ViewTestBase extends WebTestBase { foreach (ViewExecutable::getPluginTypes() as $plugin_type) { $this->container->get("plugin.manager.views.$plugin_type")->clearCachedDefinitions(); } - ViewTestData::importTestViews(get_class($this), array('views_test_config')); + ViewTestData::createTestViews(get_class($this), array('views_test_config')); } /** diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewTestConfigInstaller.php b/core/modules/views/lib/Drupal/views/Tests/ViewTestConfigInstaller.php deleted file mode 100644 index c514ebdd65b..00000000000 --- a/core/modules/views/lib/Drupal/views/Tests/ViewTestConfigInstaller.php +++ /dev/null @@ -1,27 +0,0 @@ -getStorageController('view'); $module_handler = \Drupal::moduleHandler(); foreach ($modules as $module) { $config_dir = drupal_get_path('module', $module) . '/test_views'; @@ -47,28 +44,15 @@ class ViewTestData { continue; } - $source_storage = new FileStorage($config_dir); - // Only import views used by test. - $views_to_import = array(); - foreach ($source_storage->listAll('views.view.') as $config_name) { + $file_storage = new FileStorage($config_dir); + foreach ($file_storage->listAll('views.view.') as $config_name) { $id = str_replace('views.view.', '', $config_name); if (in_array($id, $views)) { - $views_to_import[] = $config_name; + $storage_controller + ->create($file_storage->read($config_name)) + ->save(); } } - $storage_comparer = new StorageComparer( - $source_storage, - \Drupal::service('config.storage') - ); - $storage_comparer->addChangelist('create', $views_to_import); - $installer = new ViewTestConfigInstaller( - $storage_comparer, - \Drupal::service('event_dispatcher'), - \Drupal::service('config.factory'), - \Drupal::entityManager(), - \Drupal::lock() - ); - $installer->import(); } } } diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php b/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php index ab8173afb4d..e5ec825710b 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php @@ -66,7 +66,7 @@ abstract class ViewUnitTestBase extends DrupalUnitTestBase { // Tests implementing ViewUnitTestBase depend on the theme system being // properly configured. $this->installConfig(array('system')); - ViewTestData::importTestViews(get_class($this), array('views_test_config')); + ViewTestData::createTestViews(get_class($this), array('views_test_config')); } /**