Browse Source

fix tests

PECL
Antony Dovgal 19 years ago
parent
commit
0ee45c4711
  1. 6
      tests/classes/final_ctor3.phpt
  2. 45
      tests/classes/inheritance_005.phpt

6
tests/classes/final_ctor3.phpt

@ -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

45
tests/classes/inheritance_005.phpt

@ -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)
Loading…
Cancel
Save