Subject: | isa_ok fails for subclasses |
isa_ok should pass when the object being tested is a subclass of the desired class. The attached
patch fixes this.
Subject: | isa_ok.patch |
diff -ur Test.php-0.05.orig/Test.php Test.php-0.05/Test.php
--- Test.php-0.05.orig/Test.php 2007-06-06 13:45:24.000000000 +0100
+++ Test.php-0.05/Test.php 2007-06-07 20:27:30.000000000 +0100
@@ -148,8 +148,7 @@
}
function isa_ok($obj, $expected, $desc = '') {
- $name = get_class($obj);
- $pass = $name == $expected;
+ $pass = is_a($obj, $expected);
proclaim($pass, $desc, /* todo */ false, $name, $expected);
}