Commit 789ab2a3 authored by catch's avatar catch

Issue #1299424 by Niklas Fiekas, sun: Implement a one module per directory rule.

parent 25ef3c91
......@@ -6,41 +6,3 @@ core = 8.x
files[] = simpletest.test
files[] = drupal_web_test_case.php
configure = admin/config/development/testing/settings
; Tests in tests directory.
files[] = tests/actions.test
files[] = tests/ajax.test
files[] = tests/batch.test
files[] = tests/bootstrap.test
files[] = tests/cache.test
files[] = tests/common.test
files[] = tests/database_test.test
files[] = tests/error.test
files[] = tests/file.test
files[] = tests/filetransfer.test
files[] = tests/form.test
files[] = tests/graph.test
files[] = tests/image.test
files[] = tests/installer.test
files[] = tests/lock.test
files[] = tests/mail.test
files[] = tests/menu.test
files[] = tests/module.test
files[] = tests/pager.test
files[] = tests/password.test
files[] = tests/path.test
files[] = tests/queue.test
files[] = tests/registry.test
files[] = tests/schema.test
files[] = tests/session.test
files[] = tests/symfony.test
files[] = tests/tablesort.test
files[] = tests/theme.test
files[] = tests/unicode.test
files[] = tests/update.test
files[] = tests/uuid.test
files[] = tests/xmlrpc.test
files[] = tests/upgrade/upgrade.test
files[] = tests/upgrade/upgrade_bare.test
files[] = tests/upgrade/upgrade_filled.test
files[] = tests/upgrade/upgrade.language.test
......@@ -86,9 +86,9 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase {
function testUserAgentValidation() {
if (!$this->inCURL()) {
global $base_url;
$simpletest_path = $base_url . '/' . drupal_get_path('module', 'simpletest');
$HTTP_path = $simpletest_path .'/tests/http.php?q=node';
$https_path = $simpletest_path .'/tests/https.php?q=node';
$system_path = $base_url . '/' . drupal_get_path('module', 'system');
$HTTP_path = $system_path .'/tests/http.php?q=node';
$https_path = $system_path .'/tests/https.php?q=node';
// Generate a valid simpletest User-Agent to pass validation.
$this->assertTrue(preg_match('/simpletest\d+/', $this->databasePrefix, $matches), t('Database prefix contains simpletest prefix.'));
$test_ua = drupal_generate_test_ua($matches[0]);
......
......@@ -6,3 +6,40 @@ core = 8.x
files[] = system.test
required = TRUE
configure = admin/config/system
; Tests in tests directory.
files[] = tests/actions.test
files[] = tests/ajax.test
files[] = tests/batch.test
files[] = tests/bootstrap.test
files[] = tests/cache.test
files[] = tests/common.test
files[] = tests/database_test.test
files[] = tests/error.test
files[] = tests/file.test
files[] = tests/filetransfer.test
files[] = tests/form.test
files[] = tests/image.test
files[] = tests/installer.test
files[] = tests/lock.test
files[] = tests/mail.test
files[] = tests/menu.test
files[] = tests/module.test
files[] = tests/pager.test
files[] = tests/password.test
files[] = tests/path.test
files[] = tests/queue.test
files[] = tests/registry.test
files[] = tests/schema.test
files[] = tests/session.test
files[] = tests/symfony.test
files[] = tests/tablesort.test
files[] = tests/theme.test
files[] = tests/unicode.test
files[] = tests/update.test
files[] = tests/uuid.test
files[] = tests/xmlrpc.test
files[] = tests/upgrade/upgrade.test
files[] = tests/upgrade/upgrade_bare.test
files[] = tests/upgrade/upgrade_filled.test
files[] = tests/upgrade/upgrade.language.test
......@@ -615,14 +615,14 @@ class CommonCascadingStylesheetsTestCase extends DrupalWebTestCase {
// Verify common_test.css in a STYLE media="all" tag.
$elements = $this->xpath('//style[@media=:media and contains(text(), :filename)]', array(
':media' => 'all',
':filename' => 'tests/common_test.css',
':filename' => 'tests/modules/common_test/common_test.css',
));
$this->assertTrue(count($elements), "Stylesheet with media 'all' in module .info file found.");
// Verify common_test.print.css in a STYLE media="print" tag.
$elements = $this->xpath('//style[@media=:media and contains(text(), :filename)]', array(
':media' => 'print',
':filename' => 'tests/common_test.print.css',
':filename' => 'tests/modules/common_test/common_test.print.css',
));
$this->assertTrue(count($elements), "Stylesheet with media 'print' in module .info file found.");
}
......@@ -767,23 +767,22 @@ class CommonCascadingStylesheetsTestCase extends DrupalWebTestCase {
*/
function testRenderOverride() {
$system = drupal_get_path('module', 'system');
$simpletest = drupal_get_path('module', 'simpletest');
drupal_add_css($system . '/system.base.css');
drupal_add_css($simpletest . '/tests/system.base.css');
drupal_add_css($system . '/tests/system.base.css');
// The dummy stylesheet should be the only one included.
$styles = drupal_get_css();
$this->assert(strpos($styles, $simpletest . '/tests/system.base.css') !== FALSE, t('The overriding CSS file is output.'));
$this->assert(strpos($styles, $system . '/tests/system.base.css') !== FALSE, t('The overriding CSS file is output.'));
$this->assert(strpos($styles, $system . '/system.base.css') === FALSE, t('The overridden CSS file is not output.'));
drupal_add_css($simpletest . '/tests/system.base.css');
drupal_add_css($system . '/tests/system.base.css');
drupal_add_css($system . '/system.base.css');
// The standard stylesheet should be the only one included.
$styles = drupal_get_css();
$this->assert(strpos($styles, $system . '/system.base.css') !== FALSE, t('The overriding CSS file is output.'));
$this->assert(strpos($styles, $simpletest . '/tests/system.base.css') === FALSE, t('The overridden CSS file is not output.'));
$this->assert(strpos($styles, $system . '/tests/system.base.css') === FALSE, t('The overridden CSS file is not output.'));
}
/**
......@@ -2316,7 +2315,7 @@ class CommonDrupalParseInfoFileTestCase extends DrupalUnitTestCase {
* Parse an example .info file an verify the results.
*/
function testParseInfoFile() {
$info_values = drupal_parse_info_file(drupal_get_path('module', 'simpletest') . '/tests/common_test_info.txt');
$info_values = drupal_parse_info_file(drupal_get_path('module', 'system') . '/tests/common_test_info.txt');
$this->assertEqual($info_values['simple_string'], 'A simple string', t('Simple string value was parsed correctly.'), t('System'));
$this->assertEqual($info_values['simple_constant'], WATCHDOG_INFO, t('Constant value was parsed correctly.'), t('System'));
$this->assertEqual($info_values['double_colon'], 'dummyClassName::', t('Value containing double-colon was parsed correctly.'), t('System'));
......@@ -2346,14 +2345,14 @@ class CommonDrupalSystemListingTestCase extends DrupalWebTestCase {
// with Drupal core, the copy in the core modules directory takes
// precedence.
'drupal_system_listing_incompatible_test' => array(
'core/modules/simpletest/tests',
'core/modules/system/tests/modules',
'profiles/testing/modules',
),
// When both copies of the module are compatible with Drupal core, the
// copy in the profile directory takes precedence.
'drupal_system_listing_compatible_test' => array(
'profiles/testing/modules',
'core/modules/simpletest/tests',
'core/modules/system/tests/modules',
),
);
......
......@@ -24,19 +24,19 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
'%type' => 'Notice',
'!message' => 'Undefined variable: bananas',
'%function' => 'error_test_generate_warnings()',
'%file' => drupal_realpath('core/modules/simpletest/tests/error_test.module'),
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
);
$error_warning = array(
'%type' => 'Warning',
'!message' => 'Division by zero',
'%function' => 'error_test_generate_warnings()',
'%file' => drupal_realpath('core/modules/simpletest/tests/error_test.module'),
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
);
$error_user_notice = array(
'%type' => 'User warning',
'!message' => 'Drupal is awesome',
'%function' => 'error_test_generate_warnings()',
'%file' => drupal_realpath('core/modules/simpletest/tests/error_test.module'),
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
);
// Set error reporting to collect notices.
......@@ -73,14 +73,14 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
'!message' => 'Drupal is awesome',
'%function' => 'error_test_trigger_exception()',
'%line' => 57,
'%file' => drupal_realpath('core/modules/simpletest/tests/error_test.module'),
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
);
$error_pdo_exception = array(
'%type' => 'PDOException',
'!message' => 'SELECT * FROM bananas_are_awesome',
'%function' => 'error_test_trigger_pdo_exception()',
'%line' => 65,
'%file' => drupal_realpath('core/modules/simpletest/tests/error_test.module'),
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
);
$this->drupalGet('error-test/trigger-exception');
......
......@@ -12,7 +12,7 @@
$_SERVER['HTTPS'] = NULL;
ini_set('session.cookie_secure', FALSE);
foreach ($_SERVER as $key => $value) {
$_SERVER[$key] = str_replace('core/modules/simpletest/tests/http.php', 'index.php', $value);
$_SERVER[$key] = str_replace('core/modules/system/tests/http.php', 'index.php', $value);
$_SERVER[$key] = str_replace('https://', 'http://', $_SERVER[$key]);
}
......
......@@ -11,7 +11,7 @@
// Change to https.
$_SERVER['HTTPS'] = 'on';
foreach ($_SERVER as $key => $value) {
$_SERVER[$key] = str_replace('core/modules/simpletest/tests/https.php', 'index.php', $value);
$_SERVER[$key] = str_replace('core/modules/system/tests/https.php', 'index.php', $value);
$_SERVER[$key] = str_replace('http://', 'https://', $_SERVER[$key]);
}
......
......@@ -35,7 +35,7 @@ function ajax_test_menu() {
* Implements hook_system_theme_info().
*/
function ajax_test_system_theme_info() {
$themes['test_theme'] = drupal_get_path('module', 'ajax_test') . '/themes/test_theme/test_theme.info';
$themes['test_theme'] = drupal_get_path('module', 'system') . '/tests/themes/test_theme/test_theme.info';
return $themes;
}
......
......@@ -1972,7 +1972,7 @@ function form_test_load_include_custom($form, &$form_state) {
// Specify the include file and enable form caching. That way the form is
// cached when it is submitted, but needs to find the specified submit handler
// in the include.
// Filename is a bit weird here: modules/simpletest/tests/form_test.file.inc
// Filename is a bit weird here: modules/system/tests/form_test.file.inc
form_load_include($form_state, 'inc', 'form_test', 'form_test.file');
$form_state['cache'] = TRUE;
return $form;
......