aboutsummaryrefslogtreecommitdiff
path: root/mod/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'mod/diagnostics')
-rw-r--r--mod/diagnostics/languages/en.php4
-rw-r--r--mod/diagnostics/start.php16
-rw-r--r--mod/diagnostics/views/default/diagnostics/test.php2
-rw-r--r--mod/diagnostics/views/default/diagnostics/testresult.php2
4 files changed, 21 insertions, 3 deletions
diff --git a/mod/diagnostics/languages/en.php b/mod/diagnostics/languages/en.php
index 5d19824bd..df6ffdf73 100644
--- a/mod/diagnostics/languages/en.php
+++ b/mod/diagnostics/languages/en.php
@@ -24,7 +24,9 @@
'diagnostics:unittester:testresult:nottestclass' => 'FAIL - Result not a test class',
'diagnostics:unittester:testresult:fail' => 'FAIL',
- 'diagnostics:unittester:testresult:success' => 'FAIL',
+ 'diagnostics:unittester:testresult:success' => 'SUCCESS',
+
+ 'diagnostics:unittest:example' => 'Example unit test, only available in debug mode.',
'diagnostics:unittester:report' => 'Test report for %s',
diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php
index a7afe346e..de8e09468 100644
--- a/mod/diagnostics/start.php
+++ b/mod/diagnostics/start.php
@@ -22,6 +22,12 @@
// Register some actions
register_action("diagnostics/download",false, $CONFIG->pluginspath . "diagnostics/actions/download.php");
+
+ // If debug on then enable an example test
+ if ((isset($CONFIG->debug)) && ($CONFIG->debug))
+ {
+ register_elgg_test(elgg_echo('diagnostics:unittest:example'), 'diagnostics_test_test');
+ }
}
/**
@@ -37,6 +43,16 @@
}
}
+ function diagnostics_test_test()
+ {
+ ob_start();
+
+ for ($n = 0; $n<5; $n++)
+ echo "$n ";
+
+ return ElggTestResult::CreateSuccessResult(ob_get_clean());
+ }
+
/**
* Diagnostics page.
*
diff --git a/mod/diagnostics/views/default/diagnostics/test.php b/mod/diagnostics/views/default/diagnostics/test.php
index 5010eb903..9edfb4c66 100644
--- a/mod/diagnostics/views/default/diagnostics/test.php
+++ b/mod/diagnostics/views/default/diagnostics/test.php
@@ -13,7 +13,7 @@
?>
<div class="test">
<div class="test_header">
- <?php echo $vars['function']; ?>
+ <b><?php echo $vars['function']; ?></b>
</div>
<div class="test_description">
<?php echo $vars['description']; ?>
diff --git a/mod/diagnostics/views/default/diagnostics/testresult.php b/mod/diagnostics/views/default/diagnostics/testresult.php
index ddd688e93..ad43aadfb 100644
--- a/mod/diagnostics/views/default/diagnostics/testresult.php
+++ b/mod/diagnostics/views/default/diagnostics/testresult.php
@@ -30,7 +30,7 @@
<div class="testreport">
<div class="testreport_<?php echo $testresult_div; ?>">
<div class="testreport_header">
- <p><?php echo $vars['function']; ?> : <?php echo $successmessage; ?></p>
+ <p><b><?php echo $vars['function']; ?> : </b><?php echo $successmessage; ?></p>
</div>
<div class="testreport_details">
<?php echo $result->getDetails(); ?>