From 7a9e22b8f5e4933de28a780c338b0505b625c15d Mon Sep 17 00:00:00 2001
From: Bram Goffings <bramgoffings@gmail.com>
Date: Fri, 3 Aug 2012 09:12:53 +0200
Subject: [PATCH] convert setup calls

---
 lib/Drupal/views/Tests/AnalyzeTest.php               | 4 +++-
 lib/Drupal/views/Tests/ArgumentDefaultTest.php       | 4 +++-
 lib/Drupal/views/Tests/ExposedFormTest.php           | 5 +++--
 lib/Drupal/views/Tests/GlossaryTest.php              | 6 ++----
 lib/Drupal/views/Tests/HandlersTest.php              | 7 ++-----
 lib/Drupal/views/Tests/PagerTest.php                 | 6 ++----
 lib/Drupal/views/Tests/UiGroupByTest.php             | 4 ++--
 lib/Drupal/views/Tests/UiSettingsTest.php            | 3 ++-
 lib/Drupal/views/Tests/UpgradeTestCase.php           | 7 ++++---
 lib/Drupal/views/Tests/User/UserArgumentValidate.php | 4 +++-
 lib/Drupal/views/Tests/ViewsSqlTest.php              | 3 ++-
 lib/Drupal/views/Tests/WizardTestBase.php            | 4 ++--
 12 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/lib/Drupal/views/Tests/AnalyzeTest.php b/lib/Drupal/views/Tests/AnalyzeTest.php
index b86edbc..1f4fa2d 100644
--- a/lib/Drupal/views/Tests/AnalyzeTest.php
+++ b/lib/Drupal/views/Tests/AnalyzeTest.php
@@ -11,6 +11,8 @@ namespace Drupal\views\Tests;
  * Tests the views analyze system.
  */
 class AnalyzeTest extends ViewsSqlTest {
+  public static $modules = array('views_ui');
+
   public static function getInfo() {
     return array(
       'name' => 'Views Analyze',
@@ -20,7 +22,7 @@ class AnalyzeTest extends ViewsSqlTest {
   }
 
   public function setUp() {
-    parent::setUp('views_ui');
+    parent::setUp();
 
     // Add an admin user will full rights;
     $this->admin = $this->drupalCreateUser(array('administer views'));
diff --git a/lib/Drupal/views/Tests/ArgumentDefaultTest.php b/lib/Drupal/views/Tests/ArgumentDefaultTest.php
index 7d49d23..c30ec2e 100644
--- a/lib/Drupal/views/Tests/ArgumentDefaultTest.php
+++ b/lib/Drupal/views/Tests/ArgumentDefaultTest.php
@@ -13,6 +13,8 @@ use Drupal\views\View;
  * Basic test for pluggable argument default.
  */
 class ArgumentDefaultTest extends ViewsSqlTest {
+  public static $modules = array('views');
+
   public static function getInfo() {
     return array(
       'name' => 'Argument default',
@@ -22,7 +24,7 @@ class ArgumentDefaultTest extends ViewsSqlTest {
   }
 
   public function setUp() {
-    parent::setUp('views');
+    parent::setUp();
 
     $this->random = $this->randomString();
   }
diff --git a/lib/Drupal/views/Tests/ExposedFormTest.php b/lib/Drupal/views/Tests/ExposedFormTest.php
index 3546da2..f8e83ad 100644
--- a/lib/Drupal/views/Tests/ExposedFormTest.php
+++ b/lib/Drupal/views/Tests/ExposedFormTest.php
@@ -11,6 +11,8 @@ namespace Drupal\views\Tests;
  * Tests exposed forms.
  */
 class ExposedFormTest extends ViewsSqlTest {
+  public static $modules = array('views_ui');
+
   public static function getInfo() {
     return array(
       'name' => 'Exposed forms',
@@ -20,8 +22,7 @@ class ExposedFormTest extends ViewsSqlTest {
   }
 
   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);
diff --git a/lib/Drupal/views/Tests/GlossaryTest.php b/lib/Drupal/views/Tests/GlossaryTest.php
index b915d83..c73d349 100644
--- a/lib/Drupal/views/Tests/GlossaryTest.php
+++ b/lib/Drupal/views/Tests/GlossaryTest.php
@@ -11,6 +11,8 @@ namespace Drupal\views\Tests;
  * Tests glossary view ( summary of arguments ).
  */
 class GlossaryTest extends ViewsSqlTest {
+  public static $modules = array('views');
+
   public static function getInfo() {
     return array(
       'name' => 'Glossary Test',
@@ -19,10 +21,6 @@ class GlossaryTest extends ViewsSqlTest {
     );
   }
 
-  public function setUp() {
-    parent::setUp('views');
-  }
-
   /**
    * Tests the default glossary view.
    */
diff --git a/lib/Drupal/views/Tests/HandlersTest.php b/lib/Drupal/views/Tests/HandlersTest.php
index cae4efd..1ef124c 100644
--- a/lib/Drupal/views/Tests/HandlersTest.php
+++ b/lib/Drupal/views/Tests/HandlersTest.php
@@ -11,6 +11,8 @@ namespace Drupal\views\Tests;
  * Tests abstract handlers of views.
  */
 class HandlersTest extends ViewsSqlTest {
+  public static $modules = array('views_ui');
+
   public static function getInfo() {
     return array(
       'name' => 'Handlers test',
@@ -19,11 +21,6 @@ class HandlersTest extends ViewsSqlTest {
     );
   }
 
-  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);
diff --git a/lib/Drupal/views/Tests/PagerTest.php b/lib/Drupal/views/Tests/PagerTest.php
index 1967438..d93a41a 100644
--- a/lib/Drupal/views/Tests/PagerTest.php
+++ b/lib/Drupal/views/Tests/PagerTest.php
@@ -13,6 +13,8 @@ use Drupal\views\View;
  * Tests the pluggable pager system.
  */
 class PagerTest extends ViewsSqlTest {
+  public static $modules = array('views_ui', 'views_test');
+
   public static function getInfo() {
     return array(
       'name' => 'Pager',
@@ -21,10 +23,6 @@ class PagerTest extends ViewsSqlTest {
     );
   }
 
-  public function setUp() {
-    parent::setUp('views', 'views_ui', 'views_test');
-  }
-
   /**
    * Pagers was sometimes not stored.
    *
diff --git a/lib/Drupal/views/Tests/UiGroupByTest.php b/lib/Drupal/views/Tests/UiGroupByTest.php
index 15768de..01e7cde 100644
--- a/lib/Drupal/views/Tests/UiGroupByTest.php
+++ b/lib/Drupal/views/Tests/UiGroupByTest.php
@@ -14,10 +14,10 @@ use Drupal\simpletest\WebTestBase;
  */
 class UiGroupByTest extends WebTestBase {
   protected $profile = 'standard';
+  public static $modules = array('views_ui', 'views_test');
 
   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'));
diff --git a/lib/Drupal/views/Tests/UiSettingsTest.php b/lib/Drupal/views/Tests/UiSettingsTest.php
index 614e3d3..ed14152 100644
--- a/lib/Drupal/views/Tests/UiSettingsTest.php
+++ b/lib/Drupal/views/Tests/UiSettingsTest.php
@@ -13,6 +13,7 @@ use Drupal\simpletest\WebTestBase;
  * Tests the various settings in the views ui.
  */
 class UiSettingsTest extends WebTestBase {
+  public static $modules = array('views_ui');
 
   /**
    * Stores an admin user used by the different tests.
@@ -30,7 +31,7 @@ class UiSettingsTest extends WebTestBase {
   }
 
   protected function setUp() {
-    parent::setUp('views', 'views_ui');
+    parent::setUp();
     $this->adminUser = $this->drupalCreateUser(array('administer views'));
   }
 
diff --git a/lib/Drupal/views/Tests/UpgradeTestCase.php b/lib/Drupal/views/Tests/UpgradeTestCase.php
index e109d22..be88ec2 100644
--- a/lib/Drupal/views/Tests/UpgradeTestCase.php
+++ b/lib/Drupal/views/Tests/UpgradeTestCase.php
@@ -15,6 +15,10 @@ use Drupal\views\View;
  * You can find all conversions by searching for "moved to".
  */
 class UpgradeTestCase extends ViewsSqlTest {
+  // To import a view the user needs use PHP for settings rights, so enable php
+  // module.
+  public static $modules = array('php');
+
   public static function getInfo() {
     return array(
       'name' => 'Views Upgrade test',
@@ -24,10 +28,7 @@ class UpgradeTestCase extends ViewsSqlTest {
   }
 
   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();
   }
 
diff --git a/lib/Drupal/views/Tests/User/UserArgumentValidate.php b/lib/Drupal/views/Tests/User/UserArgumentValidate.php
index 06c71e2..ba40b2b 100644
--- a/lib/Drupal/views/Tests/User/UserArgumentValidate.php
+++ b/lib/Drupal/views/Tests/User/UserArgumentValidate.php
@@ -14,6 +14,8 @@ use Drupal\views\Tests\ViewsSqlTest;
  * Tests views user argument argument handler.
  */
 class UserArgumentValidate extends ViewsSqlTest {
+  public static $modules = array('views');
+
   public static function getInfo() {
     return array(
       'name' => 'Tests user argument validator',
@@ -23,7 +25,7 @@ class UserArgumentValidate extends ViewsSqlTest {
   }
 
   function setUp() {
-    parent::setUp('views');
+    parent::setUp();
     $this->account = $this->drupalCreateUser();
   }
 
diff --git a/lib/Drupal/views/Tests/ViewsSqlTest.php b/lib/Drupal/views/Tests/ViewsSqlTest.php
index 6937290..94cdbdc 100644
--- a/lib/Drupal/views/Tests/ViewsSqlTest.php
+++ b/lib/Drupal/views/Tests/ViewsSqlTest.php
@@ -8,9 +8,10 @@ namespace Drupal\views\Tests;
 use Drupal\views\View;
 
 abstract class ViewsSqlTest extends ViewsTestBase {
+  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());
diff --git a/lib/Drupal/views/Tests/WizardTestBase.php b/lib/Drupal/views/Tests/WizardTestBase.php
index 5f046e3..e3e646e 100644
--- a/lib/Drupal/views/Tests/WizardTestBase.php
+++ b/lib/Drupal/views/Tests/WizardTestBase.php
@@ -12,10 +12,10 @@ namespace Drupal\views\Tests;
  */
 abstract class WizardTestBase extends ViewsSqlTest {
   protected $profile = 'standard';
+  public static $modules = array('views_ui');
 
   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'));
-- 
1.7.11.msysgit.1

