Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function is($exp1, $exp2, $message = '')
- {
- if (is_object($exp1) || is_object($exp2))
- {
- $value = $exp1 === $exp2;
- }
- else if (is_float($exp1) && is_float($exp2))
- {
- $value = abs($exp1 - $exp2) < self::EPSILON;
- }
- else
- {
- $value = $exp1 == $exp2;
- }
- if (!$result = $this->ok($value, $message))
- {
- $this->set_last_test_errors(array(sprintf(" got: %s", var_export($exp1, true)), sprintf(" expected: %s", var_export($exp2, true))));
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment