Commit 3865a7c8 authored by damiankloip's avatar damiankloip Committed by tim.plunkett

Issue #1711640 by damiankloip, tim.plunkett, aspilicious: Use $modules property for enabling tests.

parent e42f0d8c
......@@ -11,6 +11,7 @@
* Tests the views analyze system.
*/
class AnalyzeTest extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Views Analyze',
......@@ -20,7 +21,7 @@ public static function getInfo() {
}
public function setUp() {
parent::setUp('views_ui');
parent::setUp();
// Add an admin user will full rights;
$this->admin = $this->drupalCreateUser(array('administer views'));
......
......@@ -13,6 +13,7 @@
* Basic test for pluggable argument default.
*/
class ArgumentDefaultTest extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Argument default',
......@@ -22,7 +23,7 @@ public static function getInfo() {
}
public function setUp() {
parent::setUp('views');
parent::setUp();
$this->random = $this->randomString();
}
......@@ -31,7 +32,7 @@ public function setUp() {
* Tests the use of a default argument plugin that provides no options.
*/
function testArgumentDefaultNoOptions() {
module_enable(array('views_ui', 'views_test'));
module_enable(array('views_test'));
$admin_user = $this->drupalCreateUser(array('administer views', 'administer site configuration'));
$this->drupalLogin($admin_user);
......
......@@ -11,6 +11,7 @@
* Tests exposed forms.
*/
class ExposedFormTest extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Exposed forms',
......@@ -20,8 +21,8 @@ public static function getInfo() {
}
public function setUp() {
parent::setUp('views_ui');
module_enable(array('views_ui'));
parent::setUp();
// @TODO Figure out why it's required to clear the cache here.
views_module_include('views_default', TRUE);
views_get_all_views(TRUE);
......
......@@ -11,6 +11,7 @@
* Tests glossary view ( summary of arguments ).
*/
class GlossaryTest extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Glossary Test',
......@@ -19,10 +20,6 @@ public static function getInfo() {
);
}
public function setUp() {
parent::setUp('views');
}
/**
* Tests the default glossary view.
*/
......
......@@ -11,6 +11,7 @@
* Tests abstract handlers of views.
*/
class HandlersTest extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Handlers test',
......@@ -19,11 +20,6 @@ public static function getInfo() {
);
}
protected function setUp() {
parent::setUp('views', 'views_ui');
module_enable(array('views_ui'));
}
function testFilterInOperatorUi() {
$admin_user = $this->drupalCreateUser(array('administer views', 'administer site configuration'));
$this->drupalLogin($admin_user);
......
......@@ -13,6 +13,7 @@
* Tests the pluggable pager system.
*/
class PagerTest extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Pager',
......@@ -21,10 +22,6 @@ public static function getInfo() {
);
}
public function setUp() {
parent::setUp('views', 'views_ui', 'views_test');
}
/**
* Pagers was sometimes not stored.
*
......
......@@ -13,11 +13,18 @@
* Tests UI of aggregate functionality..
*/
class UiGroupByTest extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('views_ui', 'views_test');
protected $profile = 'standard';
function setUp() {
// Enable views_ui.
parent::setUp('views_ui', 'views_test');
parent::setUp();
// Create and log in a user with administer views permission.
$views_admin = $this->drupalCreateUser(array('administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view revisions'));
......
......@@ -14,6 +14,13 @@
*/
class UiSettingsTest extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('views_ui');
/**
* Stores an admin user used by the different tests.
*
......@@ -30,7 +37,8 @@ public static function getInfo() {
}
protected function setUp() {
parent::setUp('views', 'views_ui');
parent::setUp();
$this->adminUser = $this->drupalCreateUser(array('administer views'));
}
......
......@@ -15,6 +15,17 @@
* You can find all conversions by searching for "moved to".
*/
class UpgradeTestCase extends ViewsSqlTest {
/**
* Modules to enable.
*
* To import a view the user needs use PHP for settings rights, so enable php
* module.
*
* @var array
*/
public static $modules = array('php');
public static function getInfo() {
return array(
'name' => 'Views Upgrade test',
......@@ -24,10 +35,7 @@ public static function getInfo() {
}
protected function setUp() {
// // To import a view the user needs use PHP for settings rights, so enable php module.
parent::setUp();
module_enable(array('php'));
$this->resetAll();
}
......
......@@ -14,6 +14,7 @@
* Tests views user argument argument handler.
*/
class UserArgumentValidate extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Tests user argument validator',
......@@ -23,7 +24,8 @@ public static function getInfo() {
}
function setUp() {
parent::setUp('views');
parent::setUp();
$this->account = $this->drupalCreateUser();
}
......
......@@ -9,8 +9,15 @@
abstract class ViewsSqlTest extends ViewsTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('views_ui');
protected function setUp() {
parent::setUp('views', 'views_ui');
parent::setUp();
// Define the schema and views data variable before enabling the test module.
variable_set('views_test_schema', $this->schemaDefinition());
......
......@@ -12,6 +12,14 @@
* Abstract class for views testing.
*/
abstract class ViewsTestBase extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('views');
/**
* Helper function: verify a result set returned by view.
*
......
......@@ -11,11 +11,11 @@
* Views UI wizard tests.
*/
abstract class WizardTestBase extends ViewsSqlTest {
protected $profile = 'standard';
function setUp() {
// Enable views_ui.
parent::setUp('views_ui');
parent::setUp();
// Create and log in a user with administer views permission.
$views_admin = $this->drupalCreateUser(array('administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view revisions'));
......
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