php-src/Zend/tests/traits/bug60165b.phpt
Stefan Marr 5ef2c32822 Fixed Bug #60165 (Aliasing unexisting trait should throw/trigger the exception/error)
- aliases that are not actually matching anything are treated as errors now. This
  will make sure that all methods that are expected to be in a class are actually
  there, or in case a trait changed for instance, that the code breaks already
  on composition
- Precedence declarations are also checked to ensure that the method
  which is supposed to take precedence actually exists, however,
  the other traits mentioned in the declaration are not regarded.
  We are more lenient here, since this avoids unnecessary fragility.
- fixed another seamingly unrelated test which broke in the progress
  but wasn't clear before either.
2011-11-17 21:04:15 +00:00

18 lines
329 B
PHP

--TEST--
Bug #60165 (Aliasing unexisting trait should throw/trigger the exception/error)
--FILE--
<?php
trait A {
public function bar() {}
}
class MyClass {
use A {
A::nonExistent as barA;
}
}
--EXPECTF--
Fatal error: An alias was defined for A::nonExistent but this method does not exist in %s on line %d