From bdf980c40b7a3f92dd7ac291699e1435592b1301 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 10 May 2008 06:55:09 +0000 Subject: - Patch by boombatower: fixed code style of simpletests. --- modules/simpletest/simpletest.module | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'modules/simpletest/simpletest.module') diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index c61c30f83..96d70145f 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -7,11 +7,11 @@ function simpletest_help($path, $arg) { switch ($path) { case 'admin/help#simpletest': - $output = '

'. t('The SimpleTest module is a framework for running automated unit tests in Drupal. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules.') .'

'; - $output .= '

'. t('Visit Administer >> Site building >> SimpleTest to display a list of available tests. For comprehensive testing, select all tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete.)', array('@admin-simpletest' => url('admin/build/testing'))) .'

'; - $output .= '

'. t('After the tests have run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that a test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were fails or exceptions, the results are expanded, and the tests that had issues will be indicated in red or pink rows. Use these results to refine your code and tests until all tests return a pass.') .'

'; - $output .= '

'. t('For more information on creating and modifying your own tests, see the SimpleTest API Documentation in the Drupal handbook.', array('@simpletest-api' => 'http://drupal.org/simpletest')) .'

'; - $output .= '

'. t('For more information, see the online handbook entry for SimpleTest module.', array('@simpletest' => 'http://drupal.org/handbook/modules/simpletest')) .'

'; + $output = '

' . t('The SimpleTest module is a framework for running automated unit tests in Drupal. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules.') .'

'; + $output .= '

' . t('Visit Administer >> Site building >> SimpleTest to display a list of available tests. For comprehensive testing, select all tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete.)', array('@admin-simpletest' => url('admin/build/testing'))) .'

'; + $output .= '

' . t('After the tests have run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that a test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were fails or exceptions, the results are expanded, and the tests that had issues will be indicated in red or pink rows. Use these results to refine your code and tests until all tests return a pass.') .'

'; + $output .= '

' . t('For more information on creating and modifying your own tests, see the SimpleTest API Documentation in the Drupal handbook.', array('@simpletest-api' => 'http://drupal.org/simpletest')) .'

'; + $output .= '

' . t('For more information, see the online handbook entry for SimpleTest module.', array('@simpletest' => 'http://drupal.org/handbook/modules/simpletest')) .'

'; return $output; } } @@ -68,7 +68,7 @@ function simpletest_load() { if ($user->uid != 1) { drupal_set_message(t('It is strongly suggested to run the tests with the first user!')); } - $path = drupal_get_path('module', 'simpletest') .'/'; + $path = drupal_get_path('module', 'simpletest') . '/'; foreach (array('simpletest.php', 'unit_tester.php', 'reporter.php', 'drupal_reporter.php', 'drupal_web_test_case.php', 'drupal_test_suite.php') as $file) { require_once($path . $file); } @@ -80,8 +80,8 @@ function simpletest_load() { */ function simpletest_entrypoint() { simpletest_load(); - drupal_add_css(drupal_get_path('module', 'simpletest') .'/simpletest.css', 'module'); - drupal_add_js(drupal_get_path('module', 'simpletest') .'/simpletest.js', 'module'); + drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css', 'module'); + drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js', 'module'); $output = drupal_get_form('simpletest_overview_form'); if (simpletest_running_output()) { @@ -204,30 +204,30 @@ function theme_simpletest_overview_form($form) { $row = array(); $row[] = array('id' => $test_class, 'class' => 'simpletest-select-all'); $row[] = array( - 'data' => '
'. $js['images'][0] .'
 ', + 'data' => '
' . $js['images'][0] . '
 ', 'style' => 'font-weight: bold;' ); $row[] = $element['#description']; $rows[] = array('data' => $row, 'class' => 'simpletest-group'); - $current_js = array('testClass' => $test_class .'-test', 'testNames' => array(), 'imageDirection' => 0, 'clickActive' => FALSE); + $current_js = array('testClass' => $test_class . '-test', 'testNames' => array(), 'imageDirection' => 0, 'clickActive' => FALSE); // Go through each test in the group and create table rows setting them to invisible: foreach (element_children($element['tests']) as $test_name) { - $current_js['testNames'][] = 'edit-'. $test_name; + $current_js['testNames'][] = 'edit-' . $test_name; $test = $element['tests'][$test_name]; foreach (array('title', 'description') as $key) { - $$key = $test['#'. $key]; - unset($test['#'. $key]); + $$key = $test['#' . $key]; + unset($test['#' . $key]); } $test['#name'] = $test_name; $themed_test = drupal_render($test); $row = array(); $row[] = $themed_test; - $row[] = theme('indentation', 1) .''; - $row[] = '
'. $description .'
'; - $rows[] = array('data' => $row, 'style' => 'display: none;', 'class' => $test_class .'-test'); + $row[] = theme('indentation', 1) . ''; + $row[] = '
' . $description . '
'; + $rows[] = array('data' => $row, 'style' => 'display: none;', 'class' => $test_class . '-test'); } - $js['simpletest-test-group-'. $test_class] = $current_js; + $js['simpletest-test-group-' . $test_class] = $current_js; unset($form[$gid]); // Remove test group from form. } } @@ -343,7 +343,7 @@ function simpletest_clean_temporary_directories() { $files = scandir(file_directory_path()); $count = 0; foreach ($files as $file) { - $path = file_directory_path() .'/'. $file; + $path = file_directory_path() . '/' . $file; if (is_dir($path) && preg_match('/^simpletest\d+/', $file)) { simpletest_clean_temporary_directory($path); $count++; -- cgit v1.2.3