aboutsummaryrefslogtreecommitdiff
path: root/mod/diagnostics/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/diagnostics/views')
-rw-r--r--mod/diagnostics/views/default/diagnostics/runalltests.php15
-rw-r--r--mod/diagnostics/views/default/diagnostics/test.php29
-rw-r--r--mod/diagnostics/views/default/diagnostics/testresult.php42
3 files changed, 86 insertions, 0 deletions
diff --git a/mod/diagnostics/views/default/diagnostics/runalltests.php b/mod/diagnostics/views/default/diagnostics/runalltests.php
new file mode 100644
index 000000000..12bbf2a4a
--- /dev/null
+++ b/mod/diagnostics/views/default/diagnostics/runalltests.php
@@ -0,0 +1,15 @@
+<?php
+ /**
+ * Elgg diagnostics - unit tester
+ *
+ * @package ElggDiagnostics
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.com/
+ */
+
+ $form_body .= elgg_view('input/submit', array('internalname' => 'execute', 'value' => elgg_echo('diagnostics:test:executeall')));
+
+ echo elgg_view('input/form', array('action' => $vars['url'] . "pg/diagnostics/tests/all", 'body' => $form_body));
+?> \ No newline at end of file
diff --git a/mod/diagnostics/views/default/diagnostics/test.php b/mod/diagnostics/views/default/diagnostics/test.php
new file mode 100644
index 000000000..5010eb903
--- /dev/null
+++ b/mod/diagnostics/views/default/diagnostics/test.php
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * Elgg diagnostics
+ *
+ * @package ElggDiagnostics
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.com/
+ */
+
+
+?>
+<div class="test">
+ <div class="test_header">
+ <?php echo $vars['function']; ?>
+ </div>
+ <div class="test_description">
+ <?php echo $vars['description']; ?>
+ </div>
+ <div class="test_button">
+ <?php
+
+ $form_body = elgg_view('input/submit', array('internalname' => 'execute', 'value' => elgg_echo('diagnostics:test:executetest')));
+
+ echo elgg_view('input/form', array('action' => $vars['url'] . "pg/diagnostics/tests/{$vars['function']}", 'body' => $form_body));
+ ?>
+ </div>
+</div> \ No newline at end of file
diff --git a/mod/diagnostics/views/default/diagnostics/testresult.php b/mod/diagnostics/views/default/diagnostics/testresult.php
new file mode 100644
index 000000000..ddd688e93
--- /dev/null
+++ b/mod/diagnostics/views/default/diagnostics/testresult.php
@@ -0,0 +1,42 @@
+<?php
+ /**
+ * Elgg diagnostics - test report
+ *
+ * @package ElggDiagnostics
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.com/
+ */
+
+ $result = $vars['result'];
+
+ $testresult_div = 'fail';
+ $successmessage = "";
+
+ if (!($result instanceof ElggTestResult))
+ {
+ $successmessage = elgg_echo('diagnostics:unittester:testresult:nottestclass');
+ $result = ElggTestResult::CreateFailResult(elgg_echo('diagnostics:unittester:testresult:fail'));
+ }
+ else
+ {
+ if ($result->isSuccess())
+ $successmessage = elgg_echo('diagnostics:unittester:testresult:success');
+ else
+ $successmessage = elgg_echo('diagnostics:unittester:testresult:fail');
+ }
+?>
+<div class="testreport">
+ <div class="testreport_<?php echo $testresult_div; ?>">
+ <div class="testreport_header">
+ <p><?php echo $vars['function']; ?> : <?php echo $successmessage; ?></p>
+ </div>
+ <div class="testreport_details">
+ <?php echo $result->getDetails(); ?>
+ </div>
+ <div class="testreport_debug">
+ <?php echo $result->getDebug(); ?>
+ </div>
+ </div>
+</div> \ No newline at end of file