diff --git a/core/modules/views/src/Tests/ViewStorageTest.php b/core/modules/views/src/Tests/ViewStorageTest.php index 240c730..36846de 100644 --- a/core/modules/views/src/Tests/ViewStorageTest.php +++ b/core/modules/views/src/Tests/ViewStorageTest.php @@ -233,10 +233,9 @@ protected function displayMethodTests() { $this->assertEqual($display[$id]['display_title'], 'Page 3'); // Ensure the 'default' display always has position zero, regardless of when - // it was created relative to other displays. - $view->getExecutable()->displayHandlers->remove('default'); - $view->set('id', $this->randomMachineName()); - $view->save(); + // it was set relative to other displays. Even if the 'default' display + // exists, adding it again will overwrite it, which is asserted with the new + // title. $view->addDisplay('default', $random_title); $displays = $view->get('display'); $this->assertEqual($displays['default']['display_title'], $random_title, 'Default display is defined with the new title'); diff --git a/core/modules/views_ui/src/Tests/CustomBooleanTest.php b/core/modules/views_ui/src/Tests/CustomBooleanTest.php index d61a907..f9a990b 100644 --- a/core/modules/views_ui/src/Tests/CustomBooleanTest.php +++ b/core/modules/views_ui/src/Tests/CustomBooleanTest.php @@ -60,6 +60,7 @@ public function testCustomOption() { 'plugin_id' => 'boolean', ), )); + $view->save(); $this->executeView($view); diff --git a/core/modules/views_ui/src/Tests/QueryTest.php b/core/modules/views_ui/src/Tests/QueryTest.php index fb0b9fb..bed0422 100644 --- a/core/modules/views_ui/src/Tests/QueryTest.php +++ b/core/modules/views_ui/src/Tests/QueryTest.php @@ -8,6 +8,7 @@ namespace Drupal\views_ui\Tests; use Drupal\views\Views; +use Drupal\views\Entity\View; use Drupal\views\Tests\ViewTestBase; use Drupal\views_test_data\Plugin\views\query\QueryTest as QueryTestPlugin; @@ -39,9 +40,9 @@ protected function viewsData() { * Tests query plugins settings. */ public function testQueryUI() { - $view = Views::getView('test_view'); + $view = View::load('test_view'); $display = &$view->getDisplay('default'); - $display['display_options']['query']['type'] = 'query_test'; + $display['display_options']['query'] = ['type' => 'query_test']; $view->save(); // Save some query settings.