mysql_reflection_extension.phpt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. --TEST--
  2. ReflectionExtension basics to check API
  3. --SKIPIF--
  4. <?php
  5. require_once('skipif.inc');
  6. ?>
  7. --FILE--
  8. <?php
  9. $r = new ReflectionExtension("mysql");
  10. printf("Name: %s\n", $r->name);
  11. printf("Version: %s\n", $r->getVersion());
  12. $classes = $r->getClasses();
  13. if (!empty($classes)) {
  14. printf("[002] Expecting no class\n");
  15. asort($classes);
  16. var_dump($classes);
  17. }
  18. $ignore = array();
  19. $functions = $r->getFunctions();
  20. asort($functions);
  21. printf("Functions:\n");
  22. foreach ($functions as $func) {
  23. if (isset($ignore[$func->name])) {
  24. unset($ignore[$func->name]);
  25. } else {
  26. printf(" %s\n", $func->name);
  27. }
  28. }
  29. if (!empty($ignore)) {
  30. printf("Dumping version dependent and missing functions\n");
  31. var_dump($ignore);
  32. }
  33. print "done!";
  34. ?>
  35. --EXPECTF--
  36. Name: mysql
  37. Version: 1.0
  38. Functions:
  39. mysql
  40. mysql_affected_rows
  41. mysql_client_encoding
  42. mysql_close
  43. mysql_connect
  44. mysql_data_seek
  45. mysql_db_name
  46. mysql_db_query
  47. mysql_dbname
  48. mysql_errno
  49. mysql_error
  50. mysql_escape_string
  51. mysql_fetch_array
  52. mysql_fetch_assoc
  53. mysql_fetch_field
  54. mysql_fetch_lengths
  55. mysql_fetch_object
  56. mysql_fetch_row
  57. mysql_field_flags
  58. mysql_field_len
  59. mysql_field_name
  60. mysql_field_seek
  61. mysql_field_table
  62. mysql_field_type
  63. mysql_fieldflags
  64. mysql_fieldlen
  65. mysql_fieldname
  66. mysql_fieldtable
  67. mysql_fieldtype
  68. mysql_free_result
  69. mysql_freeresult
  70. mysql_get_client_info
  71. mysql_get_host_info
  72. mysql_get_proto_info
  73. mysql_get_server_info
  74. mysql_info
  75. mysql_insert_id
  76. mysql_list_dbs
  77. mysql_list_fields
  78. mysql_list_processes
  79. mysql_list_tables
  80. mysql_listdbs
  81. mysql_listfields
  82. mysql_listtables
  83. mysql_num_fields
  84. mysql_num_rows
  85. mysql_numfields
  86. mysql_numrows
  87. mysql_pconnect
  88. mysql_ping
  89. mysql_query
  90. mysql_real_escape_string
  91. mysql_result
  92. mysql_select_db
  93. mysql_selectdb
  94. mysql_set_charset
  95. mysql_stat
  96. mysql_table_name
  97. mysql_tablename
  98. mysql_thread_id
  99. mysql_unbuffered_query
  100. done!