Commit aab8b66a authored by catch's avatar catch

Issue #1373142 by sun, beejeebus, aspilicious, amateescu: Use the Testing...

Issue #1373142 by sun, beejeebus, aspilicious, amateescu: Use the Testing profile. Speed up testbot by 50%.
parent 7b709f92
...@@ -7,7 +7,13 @@ ...@@ -7,7 +7,13 @@
class AggregatorTestCase extends DrupalWebTestCase { class AggregatorTestCase extends DrupalWebTestCase {
function setUp() { function setUp() {
parent::setUp('aggregator', 'aggregator_test'); parent::setUp(array('node', 'block', 'aggregator', 'aggregator_test'));
// Create an Article node type.
if ($this->profile != 'standard') {
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
$web_user = $this->drupalCreateUser(array('administer news feeds', 'access news feeds', 'create article content')); $web_user = $this->drupalCreateUser(array('administer news feeds', 'access news feeds', 'create article content'));
$this->drupalLogin($web_user); $this->drupalLogin($web_user);
} }
......
...@@ -18,11 +18,19 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -18,11 +18,19 @@ class BlockTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp(); parent::setUp(array('block'));
// Create Full HTML text format.
$full_html_format = array(
'format' => 'full_html',
'name' => 'Full HTML',
);
$full_html_format = (object) $full_html_format;
filter_format_save($full_html_format);
$this->checkPermissions(array(), TRUE);
// Create and log in an administrative user having access to the Full HTML // Create and log in an administrative user having access to the Full HTML
// text format. // text format.
$full_html_format = filter_format_load('full_html');
$this->admin_user = $this->drupalCreateUser(array( $this->admin_user = $this->drupalCreateUser(array(
'administer blocks', 'administer blocks',
filter_permission_name($full_html_format), filter_permission_name($full_html_format),
...@@ -43,6 +51,9 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -43,6 +51,9 @@ class BlockTestCase extends DrupalWebTestCase {
* Test creating custom block, moving it to a specific region and then deleting it. * Test creating custom block, moving it to a specific region and then deleting it.
*/ */
function testCustomBlock() { function testCustomBlock() {
// Enable a second theme.
theme_enable(array('seven'));
// Confirm that the add block link appears on block overview pages. // Confirm that the add block link appears on block overview pages.
$this->drupalGet('admin/structure/block'); $this->drupalGet('admin/structure/block');
$this->assertRaw(l('Add block', 'admin/structure/block/add'), t('Add block link is present on block overview page for default theme.')); $this->assertRaw(l('Add block', 'admin/structure/block/add'), t('Add block link is present on block overview page for default theme.'));
...@@ -51,7 +62,7 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -51,7 +62,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Confirm that hidden regions are not shown as options for block placement // Confirm that hidden regions are not shown as options for block placement
// when adding a new block. // when adding a new block.
theme_enable(array('stark')); theme_enable(array('bartik'));
$themes = list_themes(); $themes = list_themes();
$this->drupalGet('admin/structure/block/add'); $this->drupalGet('admin/structure/block/add');
foreach ($themes as $key => $theme) { foreach ($themes as $key => $theme) {
...@@ -150,6 +161,10 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -150,6 +161,10 @@ class BlockTestCase extends DrupalWebTestCase {
* Test block visibility. * Test block visibility.
*/ */
function testBlockVisibility() { function testBlockVisibility() {
// Enable Node module and change the front page path to 'node'.
module_enable(array('node'));
variable_set('site_frontpage', 'node');
$block = array(); $block = array();
// Create a random title for the block // Create a random title for the block
...@@ -171,7 +186,7 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -171,7 +186,7 @@ class BlockTestCase extends DrupalWebTestCase {
// authenticated users. // authenticated users.
$edit = array(); $edit = array();
$edit['pages'] = 'user*'; $edit['pages'] = 'user*';
$edit['roles[2]'] = TRUE; $edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = TRUE;
$this->drupalPost('admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure', $edit, t('Save block')); $this->drupalPost('admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure', $edit, t('Save block'));
// Move block to the first sidebar. // Move block to the first sidebar.
...@@ -392,14 +407,19 @@ class NonDefaultBlockAdmin extends DrupalWebTestCase { ...@@ -392,14 +407,19 @@ class NonDefaultBlockAdmin extends DrupalWebTestCase {
); );
} }
function setUp() {
parent::setUp(array('block'));
}
/** /**
* Test non-default theme admin. * Test non-default theme admin.
*/ */
function testNonDefaultBlockAdmin() { function testNonDefaultBlockAdmin() {
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes')); $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes'));
$this->drupalLogin($admin_user); $this->drupalLogin($admin_user);
theme_enable(array('stark')); $new_theme = 'bartik';
$this->drupalGet('admin/structure/block/list/stark'); theme_enable(array($new_theme));
$this->drupalGet('admin/structure/block/list/' . $new_theme);
} }
} }
...@@ -415,6 +435,10 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase { ...@@ -415,6 +435,10 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase {
); );
} }
function setUp() {
parent::setUp(array('block'));
}
/** /**
* Check the enabled Bartik blocks are correctly copied over. * Check the enabled Bartik blocks are correctly copied over.
*/ */
...@@ -441,11 +465,12 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase { ...@@ -441,11 +465,12 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase {
$blocks[$block->module][$block->delta] = $block; $blocks[$block->module][$block->delta] = $block;
} }
// Turn on the Stark theme and ensure that it contains all of the blocks // Turn on a new theme and ensure that it contains all of the blocks
// the default theme had. // the default theme had.
theme_enable(array('stark')); $new_theme = 'bartik';
variable_set('theme_default', 'stark'); theme_enable(array($new_theme));
$result = db_query('SELECT * FROM {block} WHERE theme = :theme', array(':theme' => 'stark')); variable_set('theme_default', $new_theme);
$result = db_query('SELECT * FROM {block} WHERE theme = :theme', array(':theme' => $new_theme));
foreach ($result as $block) { foreach ($result as $block) {
unset($block->theme, $block->bid); unset($block->theme, $block->bid);
$this->assertEqual($blocks[$block->module][$block->delta], $block, t('Block %name matched', array('%name' => $block->module . '-' . $block->delta))); $this->assertEqual($blocks[$block->module][$block->delta], $block, t('Block %name matched', array('%name' => $block->module . '-' . $block->delta)));
...@@ -465,6 +490,10 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase { ...@@ -465,6 +490,10 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase {
); );
} }
function setUp() {
parent::setUp(array('block'));
}
/** /**
* Check for the accessibility of the admin theme on the block admin page. * Check for the accessibility of the admin theme on the block admin page.
*/ */
...@@ -474,13 +503,13 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase { ...@@ -474,13 +503,13 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase {
$this->drupalLogin($admin_user); $this->drupalLogin($admin_user);
// Ensure that access to block admin page is denied when theme is disabled. // 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')); $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. // 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->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')); $this->assertResponse(200, t('The block admin page for the admin theme can be accessed'));
} }
} }
...@@ -502,7 +531,7 @@ class BlockCacheTestCase extends DrupalWebTestCase { ...@@ -502,7 +531,7 @@ class BlockCacheTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp('block_test'); parent::setUp(array('block', 'block_test'));
// Create an admin user, log in and enable test blocks. // Create an admin user, log in and enable test blocks.
$this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages')); $this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages'));
...@@ -686,7 +715,7 @@ class BlockHTMLIdTestCase extends DrupalWebTestCase { ...@@ -686,7 +715,7 @@ class BlockHTMLIdTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp('block_test'); parent::setUp(array('block', 'block_test'));
// Create an admin user, log in and enable test blocks. // Create an admin user, log in and enable test blocks.
$this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages')); $this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages'));
...@@ -769,7 +798,23 @@ class BlockHiddenRegionTestCase extends DrupalWebTestCase { ...@@ -769,7 +798,23 @@ class BlockHiddenRegionTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp(array('block_test')); parent::setUp(array('block', 'block_test', 'search'));
// Enable Search block in default theme.
db_merge('block')
->key(array(
'module' => 'search',
'delta' => 'form',
'theme' => variable_get('theme_default', 'stark'),
))
->fields(array(
'status' => 1,
'weight' => -1,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
))
->execute();
} }
/** /**
...@@ -780,6 +825,10 @@ class BlockHiddenRegionTestCase extends DrupalWebTestCase { ...@@ -780,6 +825,10 @@ class BlockHiddenRegionTestCase extends DrupalWebTestCase {
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes', 'search content')); $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes', 'search content'));
$this->drupalLogin($admin_user); $this->drupalLogin($admin_user);
// Ensure that the search form block is displayed.
$this->drupalGet('');
$this->assertText('Search', t('Block was displayed on the front page.'));
// Enable "block_test_theme" and set it as the default theme. // Enable "block_test_theme" and set it as the default theme.
$theme = 'block_test_theme'; $theme = 'block_test_theme';
theme_enable(array($theme)); theme_enable(array($theme));
......
...@@ -24,7 +24,7 @@ class BookTestCase extends DrupalWebTestCase { ...@@ -24,7 +24,7 @@ class BookTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp(array('book', 'node_access_test')); parent::setUp(array('book', 'block', 'node_access_test'));
// node_access_test requires a node_access_rebuild(). // node_access_test requires a node_access_rebuild().
node_access_rebuild(); node_access_rebuild();
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
*/ */
class CommentHelperCase extends DrupalWebTestCase { class CommentHelperCase extends DrupalWebTestCase {
protected $profile = 'standard';
protected $admin_user; protected $admin_user;
protected $web_user; protected $web_user;
protected $node; protected $node;
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* Tests accessible links after inaccessible links on dynamic context. * Tests accessible links after inaccessible links on dynamic context.
*/ */
class ContextualDynamicContextTestCase extends DrupalWebTestCase { class ContextualDynamicContextTestCase extends DrupalWebTestCase {
protected $profile = 'testing';
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Contextual links on node lists', 'name' => 'Contextual links on node lists',
......
...@@ -18,21 +18,11 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { ...@@ -18,21 +18,11 @@ class DashboardBlocksTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp(); parent::setUp(array('block', 'dashboard'));
// Create and log in an administrative user having access to the dashboard. // Create and log in an administrative user having access to the dashboard.
$admin_user = $this->drupalCreateUser(array('access dashboard', 'administer blocks', 'access administration pages', 'administer modules')); $admin_user = $this->drupalCreateUser(array('access dashboard', 'administer blocks', 'access administration pages', 'administer modules'));
$this->drupalLogin($admin_user); $this->drupalLogin($admin_user);
// Make sure that the dashboard is using the same theme as the rest of the
// site (and in particular, the same theme used on 403 pages). This forces
// the dashboard blocks to be the same for an administrator as for a
// regular user, and therefore lets us test that the dashboard blocks
// themselves are specifically removed for a user who does not have access
// to the dashboard page.
theme_enable(array('stark'));
variable_set('theme_default', 'stark');
variable_set('admin_theme', 'stark');
} }
/** /**
...@@ -65,6 +55,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { ...@@ -65,6 +55,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase {
*/ */
function testDashboardRegions() { function testDashboardRegions() {
$dashboard_regions = dashboard_region_descriptions(); $dashboard_regions = dashboard_region_descriptions();
$this->assertTrue(!empty($dashboard_regions), 'One or more dashboard regions found.');
// Ensure blocks can be placed in dashboard regions. // Ensure blocks can be placed in dashboard regions.
$this->drupalGet('admin/dashboard/configure'); $this->drupalGet('admin/dashboard/configure');
...@@ -113,6 +104,36 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { ...@@ -113,6 +104,36 @@ class DashboardBlocksTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/dashboard'); $this->drupalGet('admin/dashboard');
$this->assertRaw($custom_block['title'], t('Block still appears on the dashboard.')); $this->assertRaw($custom_block['title'], t('Block still appears on the dashboard.'));
} }
}
class DashboardBlockAvailabilityTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() {
return array(
'name' => 'Block availability',
'description' => 'Test blocks as used by the dashboard.',
'group' => 'Dashboard',
);
}
function setUp() {
parent::setUp();
// Create and log in an administrative user having access to the dashboard.
$admin_user = $this->drupalCreateUser(array('access dashboard', 'administer blocks', 'access administration pages', 'administer modules'));
$this->drupalLogin($admin_user);
// Make sure that the dashboard is using the same theme as the rest of the
// site (and in particular, the same theme used on 403 pages). This forces
// the dashboard blocks to be the same for an administrator as for a
// regular user, and therefore lets us test that the dashboard blocks
// themselves are specifically removed for a user who does not have access
// to the dashboard page.
theme_enable(array('stark'));
variable_set('theme_default', 'stark');
variable_set('admin_theme', 'stark');
}
/** /**
* Tests that administrative blocks are available for the dashboard. * Tests that administrative blocks are available for the dashboard.
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
*/ */
class DBLogTestCase extends DrupalWebTestCase { class DBLogTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
protected $big_user; protected $big_user;
protected $any_user; protected $any_user;
......
...@@ -23,7 +23,7 @@ class FieldSqlStorageTestCase extends DrupalWebTestCase { ...@@ -23,7 +23,7 @@ class FieldSqlStorageTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp('field_sql_storage', 'field', 'field_test', 'text'); parent::setUp('field_sql_storage', 'field', 'field_test', 'text', 'number');
$this->field_name = strtolower($this->randomName()); $this->field_name = strtolower($this->randomName());
$this->field = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4); $this->field = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4);
$this->field = field_create_field($this->field); $this->field = field_create_field($this->field);
......
...@@ -18,7 +18,7 @@ class ListFieldTestCase extends FieldTestCase { ...@@ -18,7 +18,7 @@ class ListFieldTestCase extends FieldTestCase {
} }
function setUp() { function setUp() {
parent::setUp('field_test'); parent::setUp(array('list', 'field_test'));
$this->field_name = 'test_list'; $this->field_name = 'test_list';
$this->field = array( $this->field = array(
...@@ -126,7 +126,7 @@ class ListFieldUITestCase extends FieldTestCase { ...@@ -126,7 +126,7 @@ class ListFieldUITestCase extends FieldTestCase {
} }
function setUp() { function setUp() {
parent::setUp('field_test', 'field_ui'); parent::setUp(array('list', 'field_test', 'taxonomy', 'field_ui'));
// Create test user. // Create test user.
$admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy')); $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy'));
......
...@@ -22,7 +22,7 @@ class NumberFieldTestCase extends DrupalWebTestCase { ...@@ -22,7 +22,7 @@ class NumberFieldTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp('field_test'); parent::setUp(array('node', 'field_test', 'number', 'field_ui'));
$this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer content types')); $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer content types'));
$this->drupalLogin($this->web_user); $this->drupalLogin($this->web_user);
} }
......
...@@ -15,7 +15,7 @@ class OptionsWidgetsTestCase extends FieldTestCase { ...@@ -15,7 +15,7 @@ class OptionsWidgetsTestCase extends FieldTestCase {
} }
function setUp() { function setUp() {
parent::setUp('field_test', 'list_test'); parent::setUp(array('list', 'field_test', 'list_test', 'taxonomy', 'field_ui'));
// Field with cardinality 1. // Field with cardinality 1.
$this->card_1 = array( $this->card_1 = array(
...@@ -458,6 +458,9 @@ class OptionsWidgetsTestCase extends FieldTestCase { ...@@ -458,6 +458,9 @@ class OptionsWidgetsTestCase extends FieldTestCase {
$this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit'); $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
$this->assertNoFieldChecked("edit-bool-$langcode"); $this->assertNoFieldChecked("edit-bool-$langcode");
// Create Basic page node type.
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
// Create admin user. // Create admin user.
$admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy')); $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy'));
$this->drupalLogin($admin_user); $this->drupalLogin($admin_user);
......
...@@ -238,6 +238,8 @@ class TextFieldTestCase extends DrupalWebTestCase { ...@@ -238,6 +238,8 @@ class TextFieldTestCase extends DrupalWebTestCase {
} }
class TextSummaryTestCase extends DrupalWebTestCase { class TextSummaryTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Text summary', 'name' => 'Text summary',
...@@ -406,6 +408,8 @@ class TextSummaryTestCase extends DrupalWebTestCase { ...@@ -406,6 +408,8 @@ class TextSummaryTestCase extends DrupalWebTestCase {
} }
class TextTranslationTestCase extends DrupalWebTestCase { class TextTranslationTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Text translation', 'name' => 'Text translation',
......
...@@ -1286,7 +1286,7 @@ class FieldFormTestCase extends FieldTestCase { ...@@ -1286,7 +1286,7 @@ class FieldFormTestCase extends FieldTestCase {
} }
function setUp() { function setUp() {
parent::setUp('field_test'); parent::setUp(array('node', 'field_test', 'list'));
$web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content')); $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content'));
$this->drupalLogin($web_user); $this->drupalLogin($web_user);
......
...@@ -137,8 +137,6 @@ class FieldUITestCase extends DrupalWebTestCase { ...@@ -137,8 +137,6 @@ class FieldUITestCase extends DrupalWebTestCase {
* Tests the functionality of the 'Manage fields' screen. * Tests the functionality of the 'Manage fields' screen.
*/ */
class FieldUIManageFieldsTestCase extends FieldUITestCase { class FieldUIManageFieldsTestCase extends FieldUITestCase {
protected $profile = 'testing';
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Manage fields', 'name' => 'Manage fields',
...@@ -710,7 +708,11 @@ class FieldUIAlterTestCase extends DrupalWebTestCase { ...@@ -710,7 +708,11 @@ class FieldUIAlterTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp(array('field_test')); parent::setUp(array('field_ui', 'field_test', 'text', 'list'));
// Create Article node type.
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
// Create test user. // Create test user.
$admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer users')); $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer users'));
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* Provides methods specifically for testing File module's field handling. * Provides methods specifically for testing File module's field handling.
*/ */
class FileFieldTestCase extends DrupalWebTestCase { class FileFieldTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
protected $admin_user; protected $admin_user;
function setUp() { function setUp() {
......
...@@ -161,6 +161,8 @@ class FilterCRUDTestCase extends DrupalWebTestCase { ...@@ -161,6 +161,8 @@ class FilterCRUDTestCase extends DrupalWebTestCase {
} }
class FilterAdminTestCase extends DrupalWebTestCase { class FilterAdminTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Filter administration functionality', 'name' => 'Filter administration functionality',
...@@ -419,6 +421,8 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase { ...@@ -419,6 +421,8 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase {
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
// Create a user who can administer text formats, but does not have // Create a user who can administer text formats, but does not have
// specific permission to use any of them. // specific permission to use any of them.
$this->filter_admin_user = $this->drupalCreateUser(array( $this->filter_admin_user = $this->drupalCreateUser(array(
...@@ -739,7 +743,22 @@ class FilterSecurityTestCase extends DrupalWebTestCase { ...@@ -739,7 +743,22 @@ class FilterSecurityTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp('php', 'filter_test'); parent::setUp(array('node', 'php', 'filter_test'));
// Create Basic page node type.
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
// Create Filtered HTML format.
$filtered_html_format = array(
'format' => 'filtered_html',
'name' => 'Filtered HTML',
);
$filtered_html_format = (object) $filtered_html_format;
filter_format_save($filtered_html_format);
$filtered_html_permission = filter_permission_name($filtered_html_format);
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array($filtered_html_permission));
$this->admin_user = $this->drupalCreateUser(array('administer modules', 'administer filters', 'administer site configuration')); $this->admin_user = $this->drupalCreateUser(array('administer modules', 'administer filters', 'administer site configuration'));
$this->drupalLogin($this->admin_user); $this->drupalLogin($this->admin_user);
} }
......
...@@ -27,7 +27,7 @@ class ForumTestCase extends DrupalWebTestCase { ...@@ -27,7 +27,7 @@ class ForumTestCase extends DrupalWebTestCase {
* Enable modules and create users with specific permissions. * Enable modules and create users with specific permissions.
*/ */
function setUp() { function setUp() {
parent::setUp('taxonomy', 'comment', 'forum'); parent::setUp(array('taxonomy', 'comment', 'forum', 'node', 'block', 'menu', 'help'));
// Create users. // Create users.
$this->admin_user = $this->drupalCreateUser(array( $this->admin_user = $this->drupalCreateUser(array(
'access administration pages', 'access administration pages',
...@@ -49,7 +49,7 @@ class ForumTestCase extends DrupalWebTestCase { ...@@ -49,7 +49,7 @@ class ForumTestCase extends DrupalWebTestCase {
'edit own forum content', 'edit own forum content',
'delete own forum content', 'delete own forum content',
)); ));
$this->web_user = $this->drupalCreateUser(array()); $this->web_user = $this->drupalCreateUser();
} }
/** /**
...@@ -147,7 +147,7 @@ class ForumTestCase extends DrupalWebTestCase { ...@@ -147,7 +147,7 @@ class ForumTestCase extends DrupalWebTestCase {
$this->assertFieldByXPath($xpath, '6', t('Number of posts found.')); $this->assertFieldByXPath($xpath, '6', t('Number of posts found.'));
// Test loading multiple forum nodes on the front page. // Test loading multiple forum nodes on the front page.
$this->drupalLogin($this->drupalCreateUser(array('administer content types', 'create forum content'))); $this->drupalLogin($this->drupalCreateUser(array('administer content types', 'create forum content', 'post comments')));
$this->drupalPost('admin/structure/types/manage/forum', array('node_options[promote]' => 'promote'), t('Save content type')); $this->drupalPost('admin/structure/types/manage/forum', array('node_options[promote]' => 'promote'), t('Save content type'));
$this->createForumTopic($this->forum, FALSE); $this->createForumTopic($this->forum, FALSE);
$this->createForumTopic($this->forum, FALSE); $this->createForumTopic($this->forum, FALSE);
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
* Tests help display and user access for all modules implementing help. * Tests help display and user access for all modules implementing help.
*/ */
class HelpTestCase extends DrupalWebTestCase { class HelpTestCase extends DrupalWebTestCase {
// Tests help implementations of many arbitrary core modules.
protected $profile = 'standard';
/** /**
* The admin user that will be created. * The admin user that will be created.
*/