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 @@
class AggregatorTestCase extends DrupalWebTestCase {
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'));
$this->drupalLogin($web_user);
}
......
......@@ -18,11 +18,19 @@ class BlockTestCase extends DrupalWebTestCase {
}
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
// text format.
$full_html_format = filter_format_load('full_html');
$this->admin_user = $this->drupalCreateUser(array(
'administer blocks',
filter_permission_name($full_html_format),
......@@ -43,6 +51,9 @@ class BlockTestCase extends DrupalWebTestCase {
* Test creating custom block, moving it to a specific region and then deleting it.
*/
function testCustomBlock() {
// Enable a second theme.
theme_enable(array('seven'));
// Confirm that the add block link appears on block overview pages.
$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.'));
......@@ -51,7 +62,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Confirm that hidden regions are not shown as options for block placement
// when adding a new block.
theme_enable(array('stark'));
theme_enable(array('bartik'));
$themes = list_themes();
$this->drupalGet('admin/structure/block/add');
foreach ($themes as $key => $theme) {
......@@ -150,6 +161,10 @@ class BlockTestCase extends DrupalWebTestCase {
* Test block visibility.
*/
function testBlockVisibility() {
// Enable Node module and change the front page path to 'node'.
module_enable(array('node'));
variable_set('site_frontpage', 'node');
$block = array();
// Create a random title for the block
......@@ -171,7 +186,7 @@ class BlockTestCase extends DrupalWebTestCase {
// authenticated users.
$edit = array();
$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'));
// Move block to the first sidebar.
......@@ -392,14 +407,19 @@ class NonDefaultBlockAdmin extends DrupalWebTestCase {
);
}
function setUp() {
parent::setUp(array('block'));
}
/**
* Test non-default theme admin.
*/
function testNonDefaultBlockAdmin() {
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes'));
$this->drupalLogin($admin_user);
theme_enable(array('stark'));
$this->drupalGet('admin/structure/block/list/stark');
$new_theme = 'bartik';
theme_enable(array($new_theme));
$this->drupalGet('admin/structure/block/list/' . $new_theme);
}
}
......@@ -415,6 +435,10 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase {
);
}
function setUp() {
parent::setUp(array('block'));
}
/**
* Check the enabled Bartik blocks are correctly copied over.
*/
......@@ -441,11 +465,12 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase {
$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.
theme_enable(array('stark'));
variable_set('theme_default', 'stark');
$result = db_query('SELECT * FROM {block} WHERE theme = :theme', array(':theme' => 'stark'));
$new_theme = 'bartik';
theme_enable(array($new_theme));
variable_set('theme_default', $new_theme);
$result = db_query('SELECT * FROM {block} WHERE theme = :theme', array(':theme' => $new_theme));
foreach ($result as $block) {
unset($block->theme, $block->bid);
$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 {
);
}
function setUp() {
parent::setUp(array('block'));
}
/**
* Check for the accessibility of the admin theme on the block admin page.
*/
......@@ -474,13 +503,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'));
}
}
......@@ -502,7 +531,7 @@ class BlockCacheTestCase extends DrupalWebTestCase {
}
function setUp() {
parent::setUp('block_test');
parent::setUp(array('block', 'block_test'));
// Create an admin user, log in and enable test blocks.
$this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages'));
......@@ -686,7 +715,7 @@ class BlockHTMLIdTestCase extends DrupalWebTestCase {
}
function setUp() {
parent::setUp('block_test');
parent::setUp(array('block', 'block_test'));
// Create an admin user, log in and enable test blocks.
$this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages'));
......@@ -769,7 +798,23 @@ class BlockHiddenRegionTestCase extends DrupalWebTestCase {
}
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 {
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes', 'search content'));
$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.
$theme = 'block_test_theme';
theme_enable(array($theme));
......
......@@ -24,7 +24,7 @@ class BookTestCase extends DrupalWebTestCase {
}
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_rebuild();
......
......@@ -6,6 +6,8 @@
*/
class CommentHelperCase extends DrupalWebTestCase {
protected $profile = 'standard';
protected $admin_user;
protected $web_user;
protected $node;
......
......@@ -9,8 +9,6 @@
* Tests accessible links after inaccessible links on dynamic context.
*/
class ContextualDynamicContextTestCase extends DrupalWebTestCase {
protected $profile = 'testing';
public static function getInfo() {
return array(
'name' => 'Contextual links on node lists',
......
......@@ -18,21 +18,11 @@ class DashboardBlocksTestCase extends DrupalWebTestCase {
}
function setUp() {
parent::setUp();
parent::setUp(array('block', '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'));
$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 {
*/
function testDashboardRegions() {
$dashboard_regions = dashboard_region_descriptions();
$this->assertTrue(!empty($dashboard_regions), 'One or more dashboard regions found.');
// Ensure blocks can be placed in dashboard regions.
$this->drupalGet('admin/dashboard/configure');
......@@ -113,6 +104,36 @@ class DashboardBlocksTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/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.
......
......@@ -6,6 +6,8 @@
*/
class DBLogTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
protected $big_user;
protected $any_user;
......
......@@ -23,7 +23,7 @@ class FieldSqlStorageTestCase extends DrupalWebTestCase {
}
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 = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4);
$this->field = field_create_field($this->field);
......
......@@ -18,7 +18,7 @@ class ListFieldTestCase extends FieldTestCase {
}
function setUp() {
parent::setUp('field_test');
parent::setUp(array('list', 'field_test'));
$this->field_name = 'test_list';
$this->field = array(
......@@ -126,7 +126,7 @@ class ListFieldUITestCase extends FieldTestCase {
}
function setUp() {
parent::setUp('field_test', 'field_ui');
parent::setUp(array('list', 'field_test', 'taxonomy', 'field_ui'));
// Create test user.
$admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy'));
......
......@@ -22,7 +22,7 @@ class NumberFieldTestCase extends DrupalWebTestCase {
}
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->drupalLogin($this->web_user);
}
......
......@@ -15,7 +15,7 @@ class OptionsWidgetsTestCase extends FieldTestCase {
}
function setUp() {
parent::setUp('field_test', 'list_test');
parent::setUp(array('list', 'field_test', 'list_test', 'taxonomy', 'field_ui'));
// Field with cardinality 1.
$this->card_1 = array(
......@@ -458,6 +458,9 @@ class OptionsWidgetsTestCase extends FieldTestCase {
$this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
$this->assertNoFieldChecked("edit-bool-$langcode");
// Create Basic page node type.
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
// Create admin user.
$admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy'));
$this->drupalLogin($admin_user);
......
......@@ -238,6 +238,8 @@ class TextFieldTestCase extends DrupalWebTestCase {
}
class TextSummaryTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() {
return array(
'name' => 'Text summary',
......@@ -406,6 +408,8 @@ class TextSummaryTestCase extends DrupalWebTestCase {
}
class TextTranslationTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() {
return array(
'name' => 'Text translation',
......
......@@ -1286,7 +1286,7 @@ class FieldFormTestCase extends FieldTestCase {
}
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'));
$this->drupalLogin($web_user);
......
......@@ -137,8 +137,6 @@ class FieldUITestCase extends DrupalWebTestCase {
* Tests the functionality of the 'Manage fields' screen.
*/
class FieldUIManageFieldsTestCase extends FieldUITestCase {
protected $profile = 'testing';
public static function getInfo() {
return array(
'name' => 'Manage fields',
......@@ -710,7 +708,11 @@ class FieldUIAlterTestCase extends DrupalWebTestCase {
}
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.
$admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer users'));
......
......@@ -9,6 +9,8 @@
* Provides methods specifically for testing File module's field handling.
*/
class FileFieldTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
protected $admin_user;
function setUp() {
......
......@@ -161,6 +161,8 @@ class FilterCRUDTestCase extends DrupalWebTestCase {
}
class FilterAdminTestCase extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() {
return array(
'name' => 'Filter administration functionality',
......@@ -419,6 +421,8 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase {
function setUp() {
parent::setUp();
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
// Create a user who can administer text formats, but does not have
// specific permission to use any of them.
$this->filter_admin_user = $this->drupalCreateUser(array(
......@@ -739,7 +743,22 @@ class FilterSecurityTestCase extends DrupalWebTestCase {
}
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->drupalLogin($this->admin_user);
}
......
......@@ -27,7 +27,7 @@ class ForumTestCase extends DrupalWebTestCase {
* Enable modules and create users with specific permissions.
*/
function setUp() {
parent::setUp('taxonomy', 'comment', 'forum');
parent::setUp(array('taxonomy', 'comment', 'forum', 'node', 'block', 'menu', 'help'));
// Create users.
$this->admin_user = $this->drupalCreateUser(array(
'access administration pages',
......@@ -49,7 +49,7 @@ class ForumTestCase extends DrupalWebTestCase {
'edit 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 {
$this->assertFieldByXPath($xpath, '6', t('Number of posts found.'));
// 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->createForumTopic($this->forum, FALSE);
$this->createForumTopic($this->forum, FALSE);
......
......@@ -9,6 +9,9 @@
* Tests help display and user access for all modules implementing help.
*/
class HelpTestCase extends DrupalWebTestCase {
// Tests help implementations of many arbitrary core modules.
protected $profile = 'standard';
/**
* The admin user that will be created.
*/
......
......@@ -32,7 +32,20 @@ class ImageFieldTestCase extends DrupalWebTestCase {
protected $admin_user;
function setUp() {
parent::setUp('image');
$modules = func_get_args();
if (isset($modules[0]) && is_array($modules[0])) {
$modules = $modules[0];
}
$modules[] = 'node';
$modules[] = 'image';
parent::setUp($modules);
// Create Basic page and Article node types.
if ($this->profile != 'standard') {
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
$this->admin_user = $this->drupalCreateUser(array('access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer nodes', 'create article content', 'edit any article content', 'delete any article content', 'administer image styles'));
$this->drupalLogin($this->admin_user);
}
......@@ -119,7 +132,7 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
}
function setUp() {
parent::setUp('image_module_test');
parent::setUp(array('image', 'image_module_test'));
$this->style_name = 'style_foo';
image_style_save(array('name' => $this->style_name));
......@@ -566,6 +579,10 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
);
}
function setUp() {
parent::setUp(array('field_ui'));
}
/**
* Test image formatters on node display for public files.
*/
......@@ -876,7 +893,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
}
function setUp() {
parent::setUp('rdf', 'image', 'image_module_test');
parent::setUp(array('image', 'image_module_test'));
}
/**
......@@ -917,7 +934,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="120" height="60" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" width="120" height="60" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -938,7 +955,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="60" height="120" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" width="60" height="120" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -960,7 +977,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="45" height="90" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" width="45" height="90" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -982,7 +999,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="45" height="90" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" width="45" height="90" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -1000,7 +1017,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="45" height="90" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" width="45" height="90" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -1021,7 +1038,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -1041,7 +1058,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="30" height="30" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" width="30" height="30" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -1062,7 +1079,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
$effect = image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" alt="" />');
$this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
$this->drupalGet($url);
$this->assertResponse(200, t('Image was generated at the URL.'));
......@@ -1080,7 +1097,7 @@ class ImageDimensionsUnitTest extends DrupalWebTestCase {
image_effect_save('test', $effect);
$img_tag = theme_image_style($variables);
$this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" alt="" />');
$this->assertEqual($img_tag, '<img src="' . $url . '" alt="" />');
}
}
......
......@@ -56,7 +56,7 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
'predefined_langcode' => 'fr',
);
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
$this->assertText('fr', t('Language added successfully.'));
$this->assertText('French');
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
// Check if the Default English language has no path prefix.
......@@ -915,7 +915,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
protected $admin_user = NULL;
function setUp() {
parent::setUp('locale', 'locale_test');
parent::setUp(array('locale', 'locale_test', 'dblog'));
// Set the translation file directory.
variable_set('locale_translate_file_directory', drupal_get_path('module', 'locale_test'));
......@@ -1391,8 +1391,11 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase {
protected $language;
function setUp() {
parent::setUp('locale');
parent::setUp(array('node', 'locale'));
$this->langcode = 'en';
// Create Article node type.
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
/**
......@@ -1533,7 +1536,7 @@ class LocaleLanguageSwitchingFunctionalTest extends DrupalWebTestCase {
}
function setUp() {
parent::setUp('locale');
parent::setUp(array('locale', 'block'));
// Create and login user.
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer languages', 'translate interface', 'access administration pages'));
......@@ -1833,7 +1836,7 @@ class LocaleUserCreationTest extends DrupalWebTestCase {
'predefined_langcode' => 'fr',
);
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
$this->assertText($langcode, t('Language added successfully.'));
$this->assertText('French', t('Language added successfully.'));
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
// Set language negotiation.
......@@ -1918,7 +1921,10 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
}
function setUp() {
parent::setUp('locale', 'path');
parent::setUp(array('node', 'locale', 'path'));
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
variable_set('site_frontpage', 'node');
}
/**
......@@ -2003,8 +2009,8 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
path_delete($edit);
// Create language nodes to check priority of aliases.
$first_node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
$second_node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
$first_node = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1));
$second_node = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1));
// Assign a custom path alias to the first node with the English language.
$edit = array(
......@@ -2045,6 +2051,8 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
* Functional tests for multilingual support on nodes.
*/
class LocaleContentFunctionalTest extends DrupalWebTestCase {
protected $profile = 'standard';
public static function getInfo() {
return array(