aboutsummaryrefslogtreecommitdiff
path: root/mod/developers
diff options
context:
space:
mode:
Diffstat (limited to 'mod/developers')
-rw-r--r--mod/developers/languages/en.php6
-rw-r--r--mod/developers/start.php9
-rw-r--r--mod/developers/views/default/admin/develop_tools/unit_tests.php17
3 files changed, 28 insertions, 4 deletions
diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php
index a2682363c..812f779fa 100644
--- a/mod/developers/languages/en.php
+++ b/mod/developers/languages/en.php
@@ -9,6 +9,7 @@ $english = array(
'admin:develop_tools' => 'Tools',
'admin:develop_tools:preview' => 'Theming Sandbox',
'admin:develop_tools:inspect' => 'Inspect',
+ 'admin:develop_tools:unit_tests' => 'Unit Tests',
'admin:developers' => 'Developers',
'admin:developers:settings' => 'Settings',
@@ -54,6 +55,11 @@ $english = array(
'theme_preview:navigation' => 'Navigation',
'theme_preview:typography' => 'Typography',
+ // unit tests
+ 'developers:unit_tests:description' => 'Elgg has unit and integration tests for detecting bugs in its core classes and functions.',
+ 'developers:unit_tests:warning' => 'Warning: Do Not Run These Tests on a Production Site. They can corrupt your database.',
+ 'developers:unit_tests:run' => 'Run',
+
// status messages
'developers:settings:success' => 'Settings saved',
);
diff --git a/mod/developers/start.php b/mod/developers/start.php
index 79ec0655a..d77a96b36 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -63,6 +63,7 @@ function developers_setup_menu() {
if (elgg_in_context('admin')) {
elgg_register_admin_menu_item('develop', 'inspect', 'develop_tools');
elgg_register_admin_menu_item('develop', 'preview', 'develop_tools');
+ elgg_register_admin_menu_item('develop', 'unit_tests', 'develop_tools');
elgg_register_menu_item('page', array(
'name' => 'dev_settings',
@@ -76,8 +77,8 @@ function developers_setup_menu() {
}
/**
-* Clear all the strings so the raw descriptor strings are displayed
-*/
+ * Clear all the strings so the raw descriptor strings are displayed
+ */
function developers_clear_strings() {
global $CONFIG;
@@ -121,8 +122,8 @@ function developers_wrap_views($hook, $type, $result, $params) {
}
/**
-* Log the events and plugin hooks
-*/
+ * Log the events and plugin hooks
+ */
function developers_log_events($name, $type) {
// filter out some very common events
diff --git a/mod/developers/views/default/admin/develop_tools/unit_tests.php b/mod/developers/views/default/admin/develop_tools/unit_tests.php
new file mode 100644
index 000000000..81658e88b
--- /dev/null
+++ b/mod/developers/views/default/admin/develop_tools/unit_tests.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Elgg unit and integration tests
+ *
+ */
+
+echo '<p>' . elgg_echo('developers:unit_tests:description') . '</p>';
+echo '<p><strong>' . elgg_echo('developers:unit_tests:warning') . '</strong></p>';
+
+// create a button to run tests
+$params = array(
+ 'text' => elgg_echo('developers:unit_tests:run'),
+ 'href' => 'engine/tests/suite.php',
+ 'class' => 'elgg-button elgg-button-submit',
+ 'is_trusted' => true,
+);
+echo '<p>' . elgg_view('output/url', $params) . '</p>';