diff --git a/lib/Drupal/views/Tests/ViewsSchemaTestBase.php b/lib/Drupal/views/Tests/ViewsSchemaTestBase.php new file mode 100644 index 0000000000000000000000000000000000000000..fc9aac85a32906c3a387d2c9aaa56f8d1afb1329 --- /dev/null +++ b/lib/Drupal/views/Tests/ViewsSchemaTestBase.php @@ -0,0 +1,36 @@ +<?php + +/** + * @file + * Definition of Drupal\views\Tests\ViewsSchemaTestBase. + */ + +namespace Drupal\views\Tests; + +/** + * Provides access to the test module schema and Views data. + */ +abstract class ViewsSchemaTestBase extends ViewsSqlTest { + + protected function setUp() { + parent::setUp(); + + // Define the schema and views data variable before enabling the test module. + variable_set('views_test_schema', $this->schemaDefinition()); + variable_set('views_test_views_data', $this->viewsData()); + + module_enable(array('views_test')); + $this->resetAll(); + + // Load the test dataset. + $data_set = $this->dataSet(); + $query = db_insert('views_test') + ->fields(array_keys($data_set[0])); + foreach ($data_set as $record) { + $query->values($record); + } + $query->execute(); + $this->checkPermissions(array(), TRUE); + } + +} diff --git a/lib/Drupal/views/Tests/ViewsSqlTest.php b/lib/Drupal/views/Tests/ViewsSqlTest.php index ed86e2328aecbac9a3676e86871a3b49f495e2dc..25864464504e7b163ff7ba92ea86685c25a31ed6 100644 --- a/lib/Drupal/views/Tests/ViewsSqlTest.php +++ b/lib/Drupal/views/Tests/ViewsSqlTest.php @@ -28,23 +28,6 @@ protected function setUp() { views_module_include('views_default', TRUE); views_get_all_views(TRUE); menu_router_rebuild(); - - // Define the schema and views data variable before enabling the test module. - variable_set('views_test_schema', $this->schemaDefinition()); - variable_set('views_test_views_data', $this->viewsData()); - - module_enable(array('views_test')); - $this->resetAll(); - - // Load the test dataset. - $data_set = $this->dataSet(); - $query = db_insert('views_test') - ->fields(array_keys($data_set[0])); - foreach ($data_set as $record) { - $query->values($record); - } - $query->execute(); - $this->checkPermissions(array(), TRUE); } /**