Commit b6bbc224 authored by Dave Reid's avatar Dave Reid

by Dave Reid: Fixed test invocations of setUp().

parent 3f5d7314
......@@ -14,9 +14,7 @@
class XMLSitemapTestHelper extends DrupalWebTestCase {
protected $admin_user;
function setUp() {
// Call parent::setUp() allowing test cases to pass further modules.
$modules = func_get_args();
function setUp($modules = array()) {
array_unshift($modules, 'xmlsitemap');
parent::setUp($modules);
}
......@@ -687,8 +685,9 @@ class XMLSitemapFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp('path');
function setUp($modules = array()) {
$modules[] = 'path';
parent::setUp($modules);
$this->admin_user = $this->drupalCreateUser(array('access content', 'administer site configuration', 'administer xmlsitemap'));
$this->drupalLogin($this->admin_user);
}
......@@ -771,8 +770,9 @@ class XMLSitemapRobotsTxtIntegrationTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp('robotstxt');
function setUp($modules = array()) {
$modules[] = 'robotstxt';
parent::setUp($modules);
}
function testRobotsTxt() {
......
......@@ -15,8 +15,10 @@ class XMLSitemapCustomFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp('xmlsitemap_custom', 'path');
function setUp($modules = array()) {
$modules[] = 'xmlsitemap_custom';
$modules[] = 'path';
parent::setUp($modules);
$this->admin_user = $this->drupalCreateUser(array('access content', 'administer xmlsitemap'));
$this->drupalLogin($this->admin_user);
......
......@@ -17,8 +17,11 @@ class XMLSitemapEnginesFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp(array('xmlsitemap_engines', 'xmlsitemap_engines_test'));
function setUp($modules = array()) {
$modules[] = 'xmlsitemap_engines';
$modules[] = 'xmlsitemap_engines_test';
parent::setUp($modules);
$this->admin_user = $this->drupalCreateUser(array('access content', 'administer xmlsitemap'));
$this->drupalLogin($this->admin_user);
......
......@@ -15,10 +15,12 @@ class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
/**
* Set up an administrative user account and testing keys.
*/
function setUp() {
function setUp($modules = array()) {
// Call parent::setUp() allowing test cases to pass further modules.
$modules = func_get_args();
$modules = array_merge(array('locale', 'translation', 'i18n', 'xmlsitemap_i18n'), $modules);
$modules[] = 'locale';
$modules[] = 'translation';
$modules[] = 'i18n';
$modules[] = 'xmlsitemap_i18n';
parent::setUp($modules);
// Add predefined language and reset the locale cache.
......@@ -117,8 +119,9 @@ class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
);
}
function setUp() {
parent::setUp('xmlsitemap_node');
function setUp($modules = array()) {
$modules[] = 'xmlsitemap_node';
parent::setUp($modules);
variable_set('language_content_type_page', 1);
$this->admin_user = $this->drupalCreateUser(array('administer nodes'));
......
......@@ -18,8 +18,10 @@ class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp('xmlsitemap_menu', 'menu');
function setUp($modules = array()) {
$modules[] = 'xmlsitemap_menu';
$modules[] = 'menu';
parent::setUp($modules);
$this->admin_user = $this->drupalCreateUser(array('administer menu', 'administer xmlsitemap'));
$this->normal_user = $this->drupalCreateUser(array('access content'));
......
......@@ -18,8 +18,10 @@ class XMLSitemapNodeFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp('xmlsitemap_node', 'comment');
function setUp($modules = array()) {
$modules[] = 'xmlsitemap_node';
$modules[] = 'comment';
parent::setUp($modules);
$this->admin_user = $this->drupalCreateUser(array('administer nodes', 'bypass node access', 'administer content types', 'administer xmlsitemap'));
$this->normal_user = $this->drupalCreateUser(array('create page content', 'edit any page content', 'access content', 'view own unpublished content'));
......
......@@ -18,8 +18,10 @@ class XMLSitemapTaxonomyFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp('xmlsitemap_taxonomy', 'taxonomy');
function setUp($modules = array()) {
$modules[] = 'xmlsitemap_taxonomy';
$modules[] = 'taxonomy';
parent::setUp($modules);
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'administer xmlsitemap'));
$this->normal_user = $this->drupalCreateUser(array('access content'));
......
......@@ -18,8 +18,9 @@ class XMLSitemapUserFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp() {
parent::setUp('xmlsitemap_user');
function setUp($modules = array()) {
$modules[] = 'xmlsitemap_user';
parent::setUp($modules);
// Save the user settings before creating the users.
xmlsitemap_link_bundle_settings_save('user', 'user', array('status' => 1, 'priority' => 0.5));
......
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