001.phpt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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::export',
  22. 'UMLClass::__construct',
  23. 'UMLClass::__toString',
  24. 'UMLClass::getName',
  25. 'UMLClass::isInternal',
  26. 'UMLClass::isUserDefined',
  27. 'UMLClass::isInstantiable',
  28. 'UMLClass::getFileName',
  29. 'UMLClass::getStartLine',
  30. 'UMLClass::getEndLine',
  31. 'UMLClass::getDocComment',
  32. 'UMLClass::getConstructor',
  33. 'UMLClass::getMethod',
  34. 'UMLClass::getMethods',
  35. 'UMLClass::getProperty',
  36. 'UMLClass::getProperties',
  37. 'UMLClass::getConstants',
  38. 'UMLClass::getConstant',
  39. 'UMLClass::getInterfaces',
  40. 'UMLClass::isInterface',
  41. 'UMLClass::isAbstract',
  42. 'UMLClass::isFinal',
  43. 'UMLClass::getModifiers',
  44. 'UMLClass::isInstance',
  45. 'UMLClass::newInstance',
  46. 'UMLClass::getParentClass',
  47. 'UMLClass::isSubclassOf',
  48. 'UMLClass::getStaticProperties',
  49. 'UMLClass::getDefaultProperties',
  50. 'UMLClass::isIterateable',
  51. 'UMLClass::implementsInterface',
  52. 'UMLClass::getExtension',
  53. 'UMLClass::getExtensionName');
  54. $miss = array();
  55. $res = $r->getMethodNames();
  56. foreach($exp as $m)
  57. {
  58. if (!in_array($m, $exp))
  59. {
  60. $miss[] = $m;
  61. }
  62. }
  63. var_dump($miss);
  64. $props = array_keys(get_class_vars('ReflectionClassEx'));
  65. sort($props);
  66. var_dump($props);
  67. var_dump($r->name);
  68. ?>
  69. ===DONE===
  70. --EXPECT--
  71. array(0) {
  72. }
  73. array(2) {
  74. [0]=>
  75. string(3) "bla"
  76. [1]=>
  77. string(4) "name"
  78. }
  79. string(17) "ReflectionClassEx"
  80. ===DONE===