diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php b/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php index 17b9371..0151123 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php @@ -17,28 +17,15 @@ */ abstract class ViewUnitTestBase extends DrupalUnitTestBase { - /** - * The view to use for the test. - * - * @var \Drupal\views\ViewExecutable - */ - protected $view; - protected function setUp() { parent::setUp(); - // Mock an empty request. - $this->container->register('request', new Request()); - // Define the schema and views data variable before enabling the test module. - state()->set('views_test_data_schema', $this->schemaDefinition()); - state()->set('views_test_data_views_data', $this->viewsData()); + $GLOBALS['views_test_data_schema'] = $this->schemaDefinition(); + $GLOBALS['views_test_data_views_data'] = $this->viewsData(); $this->enableModules(array('views', 'views_test_config', 'views_test_data')); - $views_bundle = new ViewsBundle(); - $views_bundle->build($this->container); - // Load the test dataset. $data_set = $this->dataSet(); $query = db_insert('views_test_data') diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewsDataTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewsDataTest.php index 65b5dee..d86bd81 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewsDataTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewsDataTest.php @@ -7,8 +7,6 @@ namespace Drupal\views\Tests; -use Drupal\views\Tests\ViewUnitTestBase; - /** * Tests the fetching of views data. * diff --git a/core/modules/views/tests/views_test_data/views_test_data.install b/core/modules/views/tests/views_test_data/views_test_data.install index 520796d..53f402a 100644 --- a/core/modules/views/tests/views_test_data/views_test_data.install +++ b/core/modules/views/tests/views_test_data/views_test_data.install @@ -9,7 +9,7 @@ * Implements hook_schema(). */ function views_test_data_schema() { - return state()->get('views_test_data_schema'); + return $GLOBALS['views_test_data_schema']; } /** diff --git a/core/modules/views/tests/views_test_data/views_test_data.module b/core/modules/views/tests/views_test_data/views_test_data.module index fd15d7a..9d5257e 100644 --- a/core/modules/views/tests/views_test_data/views_test_data.module +++ b/core/modules/views/tests/views_test_data/views_test_data.module @@ -23,7 +23,7 @@ function views_test_data_permission() { * Implements hook_views_data(). */ function views_test_data_views_data() { - return state()->get('views_test_data_views_data'); + return $GLOBALS['views_test_data_views_data']; } function views_test_data_test_static_access_callback($access) {