001.phpt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. --TEST--
  2. Reflection inheritance
  3. --FILE--
  4. <?php
  5. class ReflectionClassEx extends ReflectionClass
  6. {
  7. public $bla;
  8. function getMethodNames()
  9. {
  10. $res = array();
  11. foreach($this->getMethods() as $m)
  12. {
  13. $res[] = $m->class . '::' . $m->name;
  14. }
  15. return $res;
  16. }
  17. }
  18. $r = new ReflectionClassEx('ReflectionClassEx');
  19. $exp = array (
  20. 'UMLClass::__clone',
  21. 'UMLClass::__construct',
  22. 'UMLClass::__toString',
  23. 'UMLClass::getName',
  24. 'UMLClass::isInternal',
  25. 'UMLClass::isUserDefined',
  26. 'UMLClass::isInstantiable',
  27. 'UMLClass::getFileName',
  28. 'UMLClass::getStartLine',
  29. 'UMLClass::getEndLine',
  30. 'UMLClass::getDocComment',
  31. 'UMLClass::getConstructor',
  32. 'UMLClass::getMethod',
  33. 'UMLClass::getMethods',
  34. 'UMLClass::getProperty',
  35. 'UMLClass::getProperties',
  36. 'UMLClass::getConstants',
  37. 'UMLClass::getConstant',
  38. 'UMLClass::getInterfaces',
  39. 'UMLClass::isInterface',
  40. 'UMLClass::isAbstract',
  41. 'UMLClass::isFinal',
  42. 'UMLClass::getModifiers',
  43. 'UMLClass::isInstance',
  44. 'UMLClass::newInstance',
  45. 'UMLClass::getParentClass',
  46. 'UMLClass::isSubclassOf',
  47. 'UMLClass::getStaticProperties',
  48. 'UMLClass::getDefaultProperties',
  49. 'UMLClass::isIterateable',
  50. 'UMLClass::implementsInterface',
  51. 'UMLClass::getExtension',
  52. 'UMLClass::getExtensionName');
  53. $miss = array();
  54. $res = $r->getMethodNames();
  55. foreach($exp as $m)
  56. {
  57. if (!in_array($m, $exp))
  58. {
  59. $miss[] = $m;
  60. }
  61. }
  62. var_dump($miss);
  63. $props = array_keys(get_class_vars('ReflectionClassEx'));
  64. sort($props);
  65. var_dump($props);
  66. var_dump($r->name);
  67. ?>
  68. --EXPECT--
  69. array(0) {
  70. }
  71. array(2) {
  72. [0]=>
  73. string(3) "bla"
  74. [1]=>
  75. string(4) "name"
  76. }
  77. string(17) "ReflectionClassEx"