Commit 0fcf20f6 authored by tim.plunkett's avatar tim.plunkett
Browse files

Issue #1757154 by tim.plunkett: Add a base test class for tests that need views_test.module.

parent beb5e2e9
<?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);
}
}
...@@ -28,23 +28,6 @@ protected function setUp() { ...@@ -28,23 +28,6 @@ protected function setUp() {
views_module_include('views_default', TRUE); views_module_include('views_default', TRUE);
views_get_all_views(TRUE); views_get_all_views(TRUE);
menu_router_rebuild(); 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);
} }
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment