Guest User

Untitled

a guest
May 7th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public function is($exp1, $exp2, $message = '')
  2. {
  3. if (is_object($exp1) || is_object($exp2))
  4. {
  5. $value = $exp1 === $exp2;
  6. }
  7. else if (is_float($exp1) && is_float($exp2))
  8. {
  9. $value = abs($exp1 - $exp2) < self::EPSILON;
  10. }
  11. else
  12. {
  13. $value = $exp1 == $exp2;
  14. }
  15.  
  16. if (!$result = $this->ok($value, $message))
  17. {
  18. $this->set_last_test_errors(array(sprintf(" got: %s", var_export($exp1, true)), sprintf(" expected: %s", var_export($exp2, true))));
  19. }
  20.  
  21. return $result;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment