summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-04 15:05:37 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-04 15:05:37 +0100
commitb1b1528183d46c001afa08352ad35b2ec341ebc5 (patch)
tree01b71c8a6bd1b7a21116ccd8377c58146fefaba1
parent751f2479460c6f5cfc5333f6561d9827a92089bd (diff)
parentd2ae1d1d7fdc4b8a21369a25487c2c42e5a496bf (diff)
Merge pull request #1962 from squaresurf/d2ae1d1d7fdc4b8a21369a25487c2c42e5a496bf
Refactored Unit_test in order to remove redundant code.
-rw-r--r--system/libraries/Unit_test.php31
1 files changed, 6 insertions, 25 deletions
diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php
index 2710b5513..842b4aebd 100644
--- a/system/libraries/Unit_test.php
+++ b/system/libraries/Unit_test.php
@@ -158,7 +158,7 @@ class CI_Unit_test {
$back = $this->_backtrace();
- $report[] = array (
+ $report = array (
'test_name' => $test_name,
'test_datatype' => gettype($test),
'res_datatype' => $extype,
@@ -170,7 +170,7 @@ class CI_Unit_test {
$this->results[] = $report;
- return $this->report($this->result($report));
+ return $this->report($this->result(array($report)));
}
// --------------------------------------------------------------------
@@ -284,30 +284,11 @@ class CI_Unit_test {
continue;
}
- if (is_array($val))
+ if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val))))
{
- foreach ($val as $k => $v)
- {
- if ( ! in_array($k, $this->_test_items_visible))
- {
- continue;
- }
-
- if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v))))
- {
- $v = $line;
- }
- $temp[$CI->lang->line('ut_'.$k)] = $v;
- }
- }
- else
- {
- if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val))))
- {
- $val = $line;
- }
- $temp[$CI->lang->line('ut_'.$key)] = $val;
+ $val = $line;
}
+ $temp[$CI->lang->line('ut_'.$key)] = $val;
}
$retval[] = $temp;
@@ -415,4 +396,4 @@ function is_false($test)
}
/* End of file Unit_test.php */
-/* Location: ./system/libraries/Unit_test.php */ \ No newline at end of file
+/* Location: ./system/libraries/Unit_test.php */