locale_bug74439.phpt 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. Bug #74439 Wrong reflection on the Locale methods
  3. --EXTENSIONS--
  4. intl
  5. --FILE--
  6. <?php
  7. $methods = [
  8. 'getDefault',
  9. 'acceptFromHttp',
  10. 'canonicalize',
  11. 'composeLocale',
  12. 'getAllVariants',
  13. 'getKeywords',
  14. 'getPrimaryLanguage',
  15. 'getRegion',
  16. 'getScript',
  17. 'parseLocale',
  18. 'setDefault',
  19. 'getDisplayLanguage',
  20. 'getDisplayName',
  21. 'getDisplayRegion',
  22. 'getDisplayScript',
  23. 'getDisplayVariant',
  24. 'filterMatches',
  25. 'lookup',
  26. ];
  27. foreach ($methods as $method) {
  28. $rm = new ReflectionMethod(Locale::class, $method);
  29. printf("%s: %d, %d\n", $method, $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
  30. }
  31. ?>
  32. --EXPECT--
  33. getDefault: 0, 0
  34. acceptFromHttp: 1, 1
  35. canonicalize: 1, 1
  36. composeLocale: 1, 1
  37. getAllVariants: 1, 1
  38. getKeywords: 1, 1
  39. getPrimaryLanguage: 1, 1
  40. getRegion: 1, 1
  41. getScript: 1, 1
  42. parseLocale: 1, 1
  43. setDefault: 1, 1
  44. getDisplayLanguage: 2, 1
  45. getDisplayName: 2, 1
  46. getDisplayRegion: 2, 1
  47. getDisplayScript: 2, 1
  48. getDisplayVariant: 2, 1
  49. filterMatches: 3, 2
  50. lookup: 4, 2