summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-02-05 21:39:25 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-02-05 21:39:25 +0100
commita0b991d7de4bfbcc823c113a8438142827bf7cba (patch)
treec9dd9674ab0658e0d3cee94ea1ae4a8fd4dd6bac
parenta8d1fb52d1dadbd6d4aa4ea50f6f27a967030aa4 (diff)
Make Test-More useable for our usecase
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xapplication/third_party/test-more-php/Test-More-OO.php2
-rwxr-xr-xapplication/third_party/test-more-php/Test-Simple-OO.php9
2 files changed, 6 insertions, 5 deletions
diff --git a/application/third_party/test-more-php/Test-More-OO.php b/application/third_party/test-more-php/Test-More-OO.php
index 195c27b00..aa769e3ee 100755
--- a/application/third_party/test-more-php/Test-More-OO.php
+++ b/application/third_party/test-more-php/Test-More-OO.php
@@ -280,7 +280,7 @@ class TestMore extends TestSimple {
// Not a bail because you asked for it
if ($ok == FALSE) {
$this->diag(" Exiting due to missing requirement.");
- exit();
+ throw new RuntimeException("Missing requirement");
}
return $ok;
diff --git a/application/third_party/test-more-php/Test-Simple-OO.php b/application/third_party/test-more-php/Test-Simple-OO.php
index e91a5645b..1d33eff2e 100755
--- a/application/third_party/test-more-php/Test-Simple-OO.php
+++ b/application/third_party/test-more-php/Test-Simple-OO.php
@@ -71,6 +71,7 @@ class TestSimple {
protected $TestsRun = 0;
protected $Skips;
protected $NumberOfTests;
+ protected $CurrentTestNumber;
protected $Filter;
protected $notes;
@@ -89,7 +90,7 @@ class TestSimple {
$this->NumberOfTests = $NumberOfTests;
$this->SkipAllReason = $SkipReason;
$this->diag("Skipping all tests: $SkipReason");
- exit();
+ return;
}
// Return current value if no params passed (query to the plan)
@@ -174,7 +175,7 @@ class TestSimple {
function done_testing () {
// Change of plans (if there was one in the first place)
$this->plan((int)$this->TestsRun);
- exit();
+ return;
}
function bail ($message = '') {
@@ -184,7 +185,7 @@ class TestSimple {
static function _bail ($message = '') {
echo "Bail out! $message\n";
- exit(255);
+ throw new RuntimeException("Bail out! $message");
}
function diag() {
@@ -217,7 +218,7 @@ class TestSimple {
if ($this->Filter) ob_end_flush();
$retval = ($this->Results['Failed'] > 254) ? 254 : $this->Results['Failed'];
- exit($retval);
+ return;
}
function web_output($callback = NULL) {