protected function ViewsSqlTest::setUp in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 7.3 tests/views_query.test \ViewsSqlTest::setUp()
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix. A temporary files directory is created with the same name as the database prefix.
Parameters
...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.
Overrides DrupalWebTestCase::setUp
File
- tests/
views_query.test, line 94 - Tests for Views query features.
Class
Code
protected function setUp() {
parent::setUp('views', 'views_ui');
// 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());
variable_set('views_test_views_plugins', $this
->viewsPlugins());
module_enable(array(
'views_test',
));
drupal_install_modules(array(
'views_test',
));
drupal_get_schema('views_test', TRUE);
// Load the test dataset.
foreach ($this
->dataSet() as $record) {
drupal_write_record('views_test', $record);
}
$this
->checkPermissions(array(), TRUE);
}