summaryrefslogtreecommitdiff
path: root/modules/unit_test/libraries
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-03-04 15:11:26 -0800
committerBharat Mediratta <bharat@menalto.com>2013-03-04 15:11:26 -0800
commit20614e29c08ccdf704c93c83bb623dc55f2ef59e (patch)
treefcc05df4a51f1867a52940beec0b7044e7dfdad8 /modules/unit_test/libraries
parente77276736351700b3bbd1080369738620ff8be28 (diff)
parentd5f3dfafda51a306ebe327b868931af1b0bbdb2a (diff)
Merge pull request #186 from jozefs/travis
Integrate with Travis CI
Diffstat (limited to 'modules/unit_test/libraries')
-rw-r--r--modules/unit_test/libraries/Unit_Test.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/unit_test/libraries/Unit_Test.php b/modules/unit_test/libraries/Unit_Test.php
index 253d6fb6..15306f7e 100644
--- a/modules/unit_test/libraries/Unit_Test.php
+++ b/modules/unit_test/libraries/Unit_Test.php
@@ -67,9 +67,10 @@ class Unit_Test_Core {
*
* @param array test path(s)
* @param string filter (regular expression)
+ * @param boolean will be set to true if all tests pass
* @return void
*/
- public function __construct($extra_paths=array(), $filter=null)
+ public function __construct($extra_paths=array(), $filter=null, $all_passed=null)
{
// Merge possible default test path(s) from config with the rest
$paths = array_merge($extra_paths, Kohana::config('unit_test.paths', FALSE, FALSE));
@@ -83,6 +84,9 @@ class Unit_Test_Core {
// Take out duplicate test paths after normalization
$this->paths = array_unique($paths);
+ // Assume all tests will pass
+ $all_passed = true;
+
// Loop over each given test path
foreach ($this->paths as $path)
{
@@ -216,6 +220,7 @@ class Unit_Test_Core {
// Test failed
$this->results[$class][$method_name] = $e;
$this->stats[$class]['failed']++;
+ $all_passed = false;
}
catch (Exception $e)
{
@@ -224,6 +229,7 @@ class Unit_Test_Core {
// Test error
$this->results[$class][$method_name] = $e;
$this->stats[$class]['errors']++;
+ $all_passed = false;
}
// Calculate score