public function run($test, $expected = TRUE, $test_name = 'undefined', $notes = '')
{
if ($this->active === FALSE) {
return FALSE;
}
if (in_array($expected, array('is_object', 'is_string', 'is_bool', 'is_true', 'is_false', 'is_int', 'is_numeric', 'is_float', 'is_double', 'is_array', 'is_null', 'is_resource'), TRUE)) {
$expected = str_replace('is_double', 'is_float', $expected);
$result = $expected($test);
$extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected));
} else {
$result = $this->strict === TRUE ? $test === $expected : $test == $expected;
$extype = gettype($expected);
}
$back = $this->_backtrace();
$report = array('test_name' => $test_name, 'test_datatype' => gettype($test), 'res_datatype' => $extype, 'result' => $result === TRUE ? 'passed' : 'failed', 'file' => $back['file'], 'line' => $back['line'], 'notes' => $notes);
$this->results[] = $report;
return $this->report($this->result(array($report)));
}