Browse Source

Added tests demonstrating the same effect with abstracts

pull/2357/head
Pedro Magalhães 10 years ago
committed by Joe Watkins
parent
commit
c11b2b809d
No known key found for this signature in database GPG Key ID: F9BA0ADA31CBD89E
  1. 2
      Zend/tests/bug73987.phpt
  2. 2
      Zend/tests/bug73987_1.phpt
  3. 20
      Zend/tests/bug73987_2.phpt
  4. 20
      Zend/tests/bug73987_3.phpt

2
Zend/tests/bug73987.phpt

@ -1,5 +1,5 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent)
Bug #73987 (Method compatibility check looks to original definition and not parent - nullability interface)
--FILE--
<?php

2
Zend/tests/bug73987_1.phpt

@ -1,5 +1,5 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent)
Bug #73987 (Method compatibility check looks to original definition and not parent - return types interface)
--FILE--
<?php

20
Zend/tests/bug73987_2.phpt

@ -0,0 +1,20 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent - nullabilty abstract)
--FILE--
<?php
abstract class A {
abstract function example($a, $b, $c);
}
class B extends A {
function example($a, $b = null, $c = null) { }
}
class C extends B {
function example($a, $b, $c = null) { }
}
?>
--EXPECTF--
Fatal error: Declaration of C::example($a, $b, $c = NULL) must be compatible with B::example($a, $b = NULL, $c = NULL) in %s

20
Zend/tests/bug73987_3.phpt

@ -0,0 +1,20 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent - return types abstract)
--FILE--
<?php
abstract class A {
abstract function example();
}
class B extends A {
function example(): int { }
}
class C extends B {
function example(): string { }
}
?>
--EXPECTF--
Fatal error: Declaration of C::example(): string must be compatible with B::example(): int in %s
Loading…
Cancel
Save