Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
<?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() {
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);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment