]> granicus.if.org Git - php/commitdiff
fix tests
authorAntony Dovgal <tony2001@php.net>
Mon, 17 Mar 2008 14:59:16 +0000 (14:59 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 17 Mar 2008 14:59:16 +0000 (14:59 +0000)
tests/classes/final_ctor3.phpt
tests/classes/inheritance_005.phpt

index d37e864e2d267ad18cc084582d3a061c8bb92d25..3a61ecf902355ca3275e9569031cf622c421b694 100644 (file)
@@ -6,10 +6,8 @@ Ensure implicit final inherited old-style constructor cannot be overridden.
       final function A() { }
   }
   class B extends A {
-  }
-  class C extends B {
-      function B() { }
+      function A() { }
   }
 ?>
 --EXPECTF--
-Fatal error: Cannot override final method A::B() in %s on line 9
+Fatal error: Cannot override final method A::A() in %s on line %d
index b6f47b2a666f936bfcd1f01ef3686033b55c4dde..8990264d9204e4a7e79f92d0a2e516af10ca6ca2 100644 (file)
@@ -19,24 +19,39 @@ Check for inherited old-style constructor.
   }
   
   
-  echo "About to construct new B: ";
+  echo "About to construct new B: \n";
   $b = new B;
-  echo "About to invoke implicit B::B(): ";
-  $b->B();
   
-  echo "\nAbout to construct new C: ";
+  echo "Is B::B() callable?\n";
+  var_dump(is_callable(array($b, "B")));
+  
+  echo "Is B::A() callable?\n";
+  var_dump(is_callable(array($b, "A")));
+  
+  echo "About to construct new C: \n";
   $c = new C;
-  echo "About to invoke implicit C::B(): ";
-  $c->B();
-  echo "About to invoke implicit C::C(): ";
-  $c->C();
-?>
---EXPECTF--
-About to construct new B: In A::A
-About to invoke implicit B::B(): In A::A
 
-About to construct new C: In A::A
-About to invoke implicit C::B(): In A::A
-About to invoke implicit C::C(): In A::A
+  echo "Is C::A() callable?\n";
+  var_dump(is_callable(array($c, "A")));
 
+  echo "Is C::B() callable?\n";
+  var_dump(is_callable(array($c, "B")));
 
+  echo "Is C::C() callable?\n";
+  var_dump(is_callable(array($c, "C")));
+?>
+--EXPECTF--
+About to construct new B: 
+In A::A
+Is B::B() callable?
+bool(false)
+Is B::A() callable?
+bool(true)
+About to construct new C: 
+In A::A
+Is C::A() callable?
+bool(true)
+Is C::B() callable?
+bool(false)
+Is C::C() callable?
+bool(false)