diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php index 24bdb85..9a17de9 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php @@ -25,6 +25,14 @@ public function getFormId() { * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { + // Inform the user about the sites directory that must be created. + if (!is_dir('sites/simpletest') || !is_writable('sites/simpletest')) { + drupal_set_message(t('The sites/simpletest directory must be created and made writable for the webserver.'), 'warning'); + } + else { + drupal_set_message(t('The sites/simpletest is writable by the webserver.')); + } + $config = $this->configFactory->get('simpletest.settings'); $form['general'] = array( '#type' => 'details', diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php index c469b52..ed4ab7f 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php @@ -25,6 +25,11 @@ public function getFormId() { * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { + // Inform the user about the sites directory that must be created. + if (!is_dir('sites/simpletest') || !is_writable('sites/simpletest')) { + drupal_set_message(t('The sites/simpletest directory must be created and made writable for the webserver.'), 'warning'); + } + // JavaScript-only table filters. $form['filters'] = array( '#type' => 'container', diff --git a/core/modules/simpletest/simpletest.install b/core/modules/simpletest/simpletest.install index 4b940ed..c5e3616 100644 --- a/core/modules/simpletest/simpletest.install +++ b/core/modules/simpletest/simpletest.install @@ -154,6 +154,16 @@ function simpletest_schema() { } /** + * Implements hook_install(). + */ +function simpletest_install() { + // Inform the user about the sites directory that must be created. + if (!is_dir('sites/simpletest') || !is_writable('sites/simpletest')) { + drupal_set_message(t('The sites/simpletest directory must be created and made writable for the webserver.'), 'warning'); + } +} + +/** * Implements hook_uninstall(). */ function simpletest_uninstall() { diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index ba3e9d5..d66e9cb 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -18,6 +18,8 @@ function simpletest_help($path, $arg) { $output = ''; $output .= '

' . t('About') . '

'; $output .= '

' . t('The Testing module provides a framework for running automated unit tests. 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. For more information, see the online handbook entry for Testing module.', array('@simpletest' => 'http://drupal.org/documentation/modules/simpletest', '@blocks' => url('admin/structure/block'))) . '

'; + $output .= '

' . t('Installation'); + $output .= '

' . t('In order to be able to install test sites it is required that a sites/simpletest exists and is writable by the webserver.'); $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Running tests') . '
';