summaryrefslogtreecommitdiffstats
path: root/application/tests
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-03-09 14:31:19 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-03-09 14:31:19 +0100
commit637362a5b6bfc635c165b8144fb466348cd8e280 (patch)
treecfeeda7641f18cce3bec99c711edaf65feeae154 /application/tests
parent9cff09180700479b2618d4908aa2877e03404564 (diff)
Test: Prefix output with testcase name
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/tests')
-rw-r--r--application/tests/Test.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/application/tests/Test.php b/application/tests/Test.php
index 1f2e4fefa..b9f401bdf 100644
--- a/application/tests/Test.php
+++ b/application/tests/Test.php
@@ -9,14 +9,27 @@
namespace tests;
+require_once APPPATH."/third_party/test-more-php/Test-More-OO.php";
+
+class TestMore extends \TestMore {
+ private $TestNamePrefix = "";
+
+ public function setTestNamePrefix($prefix) {
+ $this->TestNamePrefix = $prefix;
+ }
+
+ public function ok ($Result = NULL, $TestName = NULL) {
+ return parent::ok($Result, $this->TestNamePrefix.$TestName);
+ }
+}
+
abstract class Test {
protected $t;
protected $server = "";
public function __construct()
{
- require_once APPPATH."/third_party/test-more-php/Test-More-OO.php";
- $this->t = new \TestMore();
+ $this->t = new TestMore();
$this->t->plan("no_plan");
}
@@ -106,4 +119,8 @@ abstract class Test {
{
$this->t->done_testing();
}
+
+ public function setTestNamePrefix($prefix) {
+ $this->t->setTestNamePrefix($prefix);
+ }
}