summaryrefslogtreecommitdiffstats
path: root/system/libraries/Unit_test.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-01 21:56:26 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-01 21:56:26 +0100
commit597ea27a0660bdf72f84d74566cc842e4da37efd (patch)
tree11c00369a16d21971c23a6af9ce11110e059c3d6 /system/libraries/Unit_test.php
parent254735ee011d99f5c7fe3825849d7ec0b54bd4e1 (diff)
[ci skip] DocBlocks for Email, Ftp, Unit_test and Javascript libraries
Partially fixes issue #1295
Diffstat (limited to 'system/libraries/Unit_test.php')
-rw-r--r--system/libraries/Unit_test.php51
1 files changed, 45 insertions, 6 deletions
diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php
index 5c0018d35..2710b5513 100644
--- a/system/libraries/Unit_test.php
+++ b/system/libraries/Unit_test.php
@@ -39,13 +39,52 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
class CI_Unit_test {
+ /**
+ * Active flag
+ *
+ * @var bool
+ */
public $active = TRUE;
+
+ /**
+ * Test results
+ *
+ * @var array
+ */
public $results = array();
+
+ /**
+ * Strict comparison flag
+ *
+ * Whether to use === or == when comparing
+ *
+ * @var bool
+ */
public $strict = FALSE;
+
+ /**
+ * Template
+ *
+ * @var string
+ */
protected $_template = NULL;
+
+ /**
+ * Template rows
+ *
+ * @var string
+ */
protected $_template_rows = NULL;
+
+ /**
+ * List of visible test items
+ *
+ * @var array
+ */
protected $_test_items_visible = array();
+ // --------------------------------------------------------------------
+
/**
* Constructor
*
@@ -93,9 +132,9 @@ class CI_Unit_test {
* Runs the supplied tests
*
* @param mixed $test
- * @param mixed $expected = TRUE
- * @param string $test_name = 'undefined'
- * @param string $notes = ''
+ * @param mixed $expected
+ * @param string $test_name
+ * @param string $notes
* @return string
*/
public function run($test, $expected = TRUE, $test_name = 'undefined', $notes = '')
@@ -113,7 +152,7 @@ class CI_Unit_test {
}
else
{
- $result = ($this->strict === TRUE) ? ($test === $expected) : ($test === $expected);
+ $result = ($this->strict === TRUE) ? ($test === $expected) : ($test == $expected);
$extype = gettype($expected);
}
@@ -141,7 +180,7 @@ class CI_Unit_test {
*
* Displays a table with the test data
*
- * @param array $result = array()
+ * @param array $result
* @return string
*/
public function report($result = array())
@@ -221,7 +260,7 @@ class CI_Unit_test {
*
* Returns the raw result data
*
- * @param array $results = array()
+ * @param array $results
* @return array
*/
public function result($results = array())