diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index bd0c6c1..ff4773f 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -456,10 +456,12 @@ function aggregator_save_category($edit) { ->condition('cid', $edit['cid']) ->execute(); // Make sure there is no active block for this category. - db_delete('block') - ->condition('module', 'aggregator') - ->condition('delta', 'category-' . $edit['cid']) - ->execute(); + if (module_exists('block')) { + db_delete('block') + ->condition('module', 'aggregator') + ->condition('delta', 'category-' . $edit['cid']) + ->execute(); + } $edit['title'] = ''; $op = 'delete'; } @@ -521,10 +523,12 @@ function aggregator_save_feed($edit) { ->condition('fid', $edit['fid']) ->execute(); // Make sure there is no active block for this feed. - db_delete('block') - ->condition('module', 'aggregator') - ->condition('delta', 'feed-' . $edit['fid']) - ->execute(); + if (module_exists('block')) { + db_delete('block') + ->condition('module', 'aggregator') + ->condition('delta', 'feed-' . $edit['fid']) + ->execute(); + } } elseif (!empty($edit['title'])) { $edit['fid'] = db_insert('aggregator_feed') diff --git a/core/modules/aggregator/aggregator.test b/core/modules/aggregator/aggregator.test index 522129f..bacabb1 100644 --- a/core/modules/aggregator/aggregator.test +++ b/core/modules/aggregator/aggregator.test @@ -7,7 +7,22 @@ class AggregatorTestCase extends DrupalWebTestCase { function setUp() { - parent::setUp('aggregator', 'aggregator_test'); + parent::setUp(array('node', 'aggregator', 'aggregator_test')); + + // Create an Article node type. + $type = array( + 'type' => 'article', + 'name' => t('Article'), + 'base' => 'node_content', + 'custom' => 1, + 'modified' => 1, + 'locked' => 0, + ); + $type = node_type_set_defaults($type); + node_type_save($type); + node_add_body_field($type); + $this->resetAll(); + $web_user = $this->drupalCreateUser(array('administer news feeds', 'access news feeds', 'create article content')); $this->drupalLogin($web_user); } diff --git a/core/modules/block/block.test b/core/modules/block/block.test index dbd7dc4..50f3246 100644 --- a/core/modules/block/block.test +++ b/core/modules/block/block.test @@ -465,6 +465,10 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase { ); } + function setUp() { + parent::setUp(array('block')); + } + /** * Check for the accessibility of the admin theme on the block admin page. */ @@ -474,13 +478,13 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase { $this->drupalLogin($admin_user); // Ensure that access to block admin page is denied when theme is disabled. - $this->drupalGet('admin/structure/block/list/stark'); + $this->drupalGet('admin/structure/block/list/bartik'); $this->assertResponse(403, t('The block admin page for a disabled theme can not be accessed')); // Enable admin theme and confirm that tab is accessible. - $edit['admin_theme'] = 'stark'; + $edit['admin_theme'] = 'bartik'; $this->drupalPost('admin/appearance', $edit, t('Save configuration')); - $this->drupalGet('admin/structure/block/list/stark'); + $this->drupalGet('admin/structure/block/list/bartik'); $this->assertResponse(200, t('The block admin page for the admin theme can be accessed')); } } diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php index 0edd3fd..aa6ea4d 100644 --- a/core/modules/simpletest/drupal_web_test_case.php +++ b/core/modules/simpletest/drupal_web_test_case.php @@ -765,7 +765,7 @@ class DrupalWebTestCase extends DrupalTestCase { * * @var string */ - protected $profile = 'standard'; + protected $profile = 'testing'; /** * The URL currently loaded in the internal browser. diff --git a/core/modules/simpletest/tests/ajax.test b/core/modules/simpletest/tests/ajax.test index 9a76b96..00eb164 100644 --- a/core/modules/simpletest/tests/ajax.test +++ b/core/modules/simpletest/tests/ajax.test @@ -58,8 +58,6 @@ class AJAXTestCase extends DrupalWebTestCase { * Tests primary Ajax framework functions. */ class AJAXFrameworkTestCase extends AJAXTestCase { - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'AJAX framework', diff --git a/core/modules/simpletest/tests/common.test b/core/modules/simpletest/tests/common.test index 8936808..c66e9c3 100644 --- a/core/modules/simpletest/tests/common.test +++ b/core/modules/simpletest/tests/common.test @@ -2196,11 +2196,6 @@ class ParseInfoFilesTestCase extends DrupalWebTestCase { * Tests for the drupal_system_listing() function. */ class DrupalSystemListingTestCase extends DrupalWebTestCase { - /** - * Use the testing profile; this is needed for testDirectoryPrecedence(). - */ - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Drupal system listing', diff --git a/core/modules/simpletest/tests/database_test.test b/core/modules/simpletest/tests/database_test.test index 6e55fbd..164ddce 100644 --- a/core/modules/simpletest/tests/database_test.test +++ b/core/modules/simpletest/tests/database_test.test @@ -16,8 +16,6 @@ class FakeRecord { } * here. */ class DatabaseTestCase extends DrupalWebTestCase { - protected $profile = 'testing'; - function setUp() { parent::setUp('database_test'); diff --git a/core/modules/simpletest/tests/form.test b/core/modules/simpletest/tests/form.test index 94dfa87..504a111 100644 --- a/core/modules/simpletest/tests/form.test +++ b/core/modules/simpletest/tests/form.test @@ -372,8 +372,6 @@ class FormsTestCase extends DrupalWebTestCase { * Tests building and processing of core form elements. */ class FormElementTestCase extends DrupalWebTestCase { - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Element processing', diff --git a/core/modules/simpletest/tests/menu.test b/core/modules/simpletest/tests/menu.test index d0612ac..df9b80c 100644 --- a/core/modules/simpletest/tests/menu.test +++ b/core/modules/simpletest/tests/menu.test @@ -647,9 +647,6 @@ class MenuRouterTestCase extends DrupalWebTestCase { * Tests for menu links. */ class MenuLinksUnitTestCase extends DrupalWebTestCase { - // Use the lightweight testing profile for this test. - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Menu links', @@ -1520,12 +1517,7 @@ class MenuTrailTestCase extends MenuWebTestCase { } function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'menu_test'; - parent::setUp($modules); + parent::setUp(array('block', 'menu_test')); $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/simpletest/tests/password.test b/core/modules/simpletest/tests/password.test index e0139e9..2797786 100644 --- a/core/modules/simpletest/tests/password.test +++ b/core/modules/simpletest/tests/password.test @@ -9,8 +9,6 @@ * Unit tests for password hashing API. */ class PasswordHashingTest extends DrupalWebTestCase { - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Password hashing', diff --git a/core/modules/simpletest/tests/theme.test b/core/modules/simpletest/tests/theme.test index 6fb6b3b..7649e3d 100644 --- a/core/modules/simpletest/tests/theme.test +++ b/core/modules/simpletest/tests/theme.test @@ -9,8 +9,6 @@ * Unit tests for the Theme API. */ class ThemeUnitTest extends DrupalWebTestCase { - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Theme API', @@ -178,8 +176,6 @@ class ThemeTableUnitTest extends DrupalWebTestCase { * Tests for common theme functions. */ class ThemeFunctionsTestCase extends DrupalWebTestCase { - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Theme functions', diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 6dca80b..117bf5e 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1487,7 +1487,7 @@ function system_site_information_settings() { $form['front_page']['site_frontpage'] = array( '#type' => 'textfield', '#title' => t('Default front page'), - '#default_value' => (variable_get('site_frontpage')!='node'?drupal_get_path_alias(variable_get('site_frontpage', 'node')):''), + '#default_value' => (variable_get('site_frontpage')!='user'?drupal_get_path_alias(variable_get('site_frontpage', 'user')):''), '#size' => 40, '#description' => t('Optionally, specify a relative URL to display as the front page. Leave blank to display the default content feed.'), '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='), @@ -1536,7 +1536,7 @@ function system_site_information_settings_validate($form, &$form_state) { // Check for empty front page path. if (empty($form_state['values']['site_frontpage'])) { // Set to default "node". - form_set_value($form['front_page']['site_frontpage'], 'node', $form_state); + form_set_value($form['front_page']['site_frontpage'], 'user', $form_state); } else { // Get the normal path of the front page. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 625be0a..756f375 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2036,8 +2036,12 @@ function system_user_timezone(&$form, &$form_state) { function system_block_info() { $blocks['main'] = array( 'info' => t('Main page content'), - // Cached elsewhere. + // Cached elsewhere. 'cache' => DRUPAL_NO_CACHE, + // Automatically try to assign the main content to the "content" region, in + // case such a region exists. + 'region' => 'content', + 'status' => 1, ); $blocks['powered-by'] = array( 'info' => t('Powered by Drupal'), diff --git a/core/modules/system/system.test b/core/modules/system/system.test index 4e3761d..c767254 100644 --- a/core/modules/system/system.test +++ b/core/modules/system/system.test @@ -130,8 +130,6 @@ class ModuleTestCase extends DrupalWebTestCase { * Test module enabling/disabling functionality. */ class EnableDisableTestCase extends ModuleTestCase { - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Enable/disable modules', @@ -885,10 +883,13 @@ class AccessDeniedTestCase extends DrupalWebTestCase { } function setUp() { - parent::setUp(); + parent::setUp(array('block')); // Create an administrative user. $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration', 'administer blocks')); + + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user profiles')); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access user profiles')); } function testAccessDenied() { @@ -896,34 +897,34 @@ class AccessDeniedTestCase extends DrupalWebTestCase { $this->assertText(t('Access denied'), t('Found the default 403 page')); $this->assertResponse(403); + // Use a custom 403 page. $this->drupalLogin($this->admin_user); $edit = array( - 'title' => $this->randomName(10), - 'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(100)))), + 'site_403' => 'user/' . $this->admin_user->uid, ); - $node = $this->drupalCreateNode($edit); - - // Use a custom 403 page. - $this->drupalPost('admin/config/system/site-information', array('site_403' => 'node/' . $node->nid), t('Save configuration')); + $this->drupalPost('admin/config/system/site-information', $edit, t('Save configuration')); - $this->drupalLogout(); - $this->drupalGet('admin'); - $this->assertText($node->title, t('Found the custom 403 page')); + // Enable the user login block. + $edit = array( + 'blocks[user_login][region]' => 'sidebar_first', + ); + $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); // Logout and check that the user login block is shown on custom 403 pages. $this->drupalLogout(); - $this->drupalGet('admin'); - $this->assertText($node->title, t('Found the custom 403 page')); + $this->assertText($this->admin_user->name, t('Found the custom 403 page')); $this->assertText(t('User login'), t('Blocks are shown on the custom 403 page')); // Log back in and remove the custom 403 page. $this->drupalLogin($this->admin_user); - $this->drupalPost('admin/config/system/site-information', array('site_403' => ''), t('Save configuration')); + $edit = array( + 'site_403' => '', + ); + $this->drupalPost('admin/config/system/site-information', $edit, t('Save configuration')); // Logout and check that the user login block is shown on default 403 pages. $this->drupalLogout(); - $this->drupalGet('admin'); $this->assertText(t('Access denied'), t('Found the default 403 page')); $this->assertResponse(403); @@ -950,9 +951,6 @@ class AccessDeniedTestCase extends DrupalWebTestCase { class PageNotFoundTestCase extends DrupalWebTestCase { protected $admin_user; - /** - * Implement getInfo(). - */ public static function getInfo() { return array( 'name' => '404 functionality', @@ -961,32 +959,29 @@ class PageNotFoundTestCase extends DrupalWebTestCase { ); } - /** - * Implement setUp(). - */ function setUp() { parent::setUp(); // Create an administrative user. $this->admin_user = $this->drupalCreateUser(array('administer site configuration')); - $this->drupalLogin($this->admin_user); + + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user profiles')); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access user profiles')); } function testPageNotFound() { + $this->drupalLogin($this->admin_user); $this->drupalGet($this->randomName(10)); $this->assertText(t('Page not found'), t('Found the default 404 page')); + // Use a custom 404 page. $edit = array( - 'title' => $this->randomName(10), - 'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(100)))), + 'site_404' => 'user/' . $this->admin_user->uid, ); - $node = $this->drupalCreateNode($edit); - - // Use a custom 404 page. - $this->drupalPost('admin/config/system/site-information', array('site_404' => 'node/' . $node->nid), t('Save configuration')); + $this->drupalPost('admin/config/system/site-information', $edit, t('Save configuration')); $this->drupalGet($this->randomName(10)); - $this->assertText($node->title, t('Found the custom 404 page')); + $this->assertText($this->admin_user->name, t('Found the custom 404 page')); } } @@ -1447,8 +1442,6 @@ class FrontPageTestCase extends DrupalWebTestCase { } class SystemBlockTestCase extends DrupalWebTestCase { - protected $profile = 'testing'; - public static function getInfo() { return array( 'name' => 'Block functionality',