summaryrefslogtreecommitdiff
path: root/ext/intl/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Christoph M. Becker2021-02-171-0/+16
|\ | | | | | | | | * PHP-8.0: Fix #80763: msgfmt_format() does not accept DateTime references
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-171-0/+16
| |\ | | | | | | | | | | | | * PHP-7.4: Fix #80763: msgfmt_format() does not accept DateTime references
| | * Fix #80763: msgfmt_format() does not accept DateTime referencesChristoph M. Becker2021-02-171-0/+16
| | | | | | | | | | | | | | | | | | `intl_zval_to_millis()` needs to cater to references. Closes GH-6707.
* | | Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-119-16/+37
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* | Fixed bug #80644: ResourceBundle::get() doesn't reset error stateNikita Popov2021-01-191-0/+6
| |
* | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-11-068-4/+701
|\ \ | |/ | | | | | | * PHP-7.4: Split tests for compatibility with ICU 68.1
| * Split tests for compatibility with ICU 68.1Christoph M. Becker2020-11-068-4/+701
| |
* | Improve parameter names in ext/intlMáté Kocsis2020-10-1224-41/+41
| | | | | | | | Closes GH-6309
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-121-8/+8
|\ \ | |/ | | | | | | * PHP-7.4: intl: report more information about message pattern parse errors
| * intl: report more information about message pattern parse errorsPhilip Hofstetter2020-10-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The message patterns can be pretty complex, so reporting a generic U_PARSE_ERROR without any additional information makes it needlessly hard to fix erroneous patterns. This commit makes use of the additional UParseError* parameter to umsg_open to retrieve more details about the parse error to report that to the user via intl_get_error_message() Additional improve error reporting from the IntlMessage constructor. Previously, all possible failures when calling IntlMessage::__construct() would be masked away with a generic "Constructor failed" message. This would include invalid patterns. This commit makes sure that the underlying error that caused the constructor failure is reported as part of the IntlException error message. Closes GH-6325.
| * Update intl test suite for ICU 67.1Christoph M. Becker2020-06-054-3/+469
| | | | | | | | Cherry-picked from c915c601710e2a44e6c7f89fcb12b8047c968108.
* | Fix out of bounds offset handling with empty needleNikita Popov2020-10-011-0/+52
| | | | | | | | For strrpos with positive out of bounds offsets was not detected.
* | Allow empty needle in grapheme_str*pos, grapheme_str*strChristian Schneider2020-10-011-76/+48
| | | | | | | | | | | | | | For consistency with str* and mb_str* functions. Closes GH-6245. Closes php/php-tasks#20.
* | Skip test with ICU version < 58Matteo Beccati2020-09-261-1/+5
| |
* | Promote warning to ValueError for Spoofchecker::setRestrictionLevel()George Peter Banyard2020-09-251-0/+17
| | | | | | | | Closes GH-6197
* | Normalize substr() behaviorNikita Popov2020-09-254-64/+88
| | | | | | | | | | | | | | | | | | | | | | | | Make the behavior of substr(), mb_substr(), iconv_substr() and grapheme_substr() consistent when it comes to the handling of out of bounds offsets. substr() will now always clamp out of bounds offsets to the string boundary. Cases that previously returned false will now return an empty string. This means that substr() itself *always* returns a string now (like mb_substr() already did before.) Closes GH-6182.
* | Try to fix testNikita Popov2020-09-221-2/+1
| |
* | Handle out-of-bounds offset consistently in grapheme_* APINikita Popov2020-09-221-0/+76
| | | | | | | | | | | | Make sure we throw the same kind of error regardless of whether the offset is out-of-bounds in the fast path or in the slow path.
* | Fix grapheme out of bounds checkNikita Popov2020-09-222-1/+96
| | | | | | | | An offset equal to the string length is not out of bounds.
* | Consolidate the usage of "either" and "one of" in error messagesMáté Kocsis2020-09-201-1/+1
| | | | | | | | Closes GH-6173
* | Run tidyNikita Popov2020-09-18196-210/+210
| | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | Declare array|int and object-of-class|int types in stubsMáté Kocsis2020-09-141-2/+2
| | | | | | | | | | | | Closes GH-6081 Co-Authored-By: Nikita Popov <nikic@php.net>
* | Improve error messages mentioning parameters instead of argumentsMáté Kocsis2020-09-0912-35/+35
| | | | | | | | Closes GH-5999
* | Promote warnings to exceptions in ext/intlMáté Kocsis2020-09-077-57/+192
| | | | | | | | Closes GH-5972
* | Prevent ResourceBundle double-constructionNikita Popov2020-08-261-0/+18
| |
* | Prevent double-construction of NumberFormatterNikita Popov2020-08-261-0/+12
| |
* | Prevent double-construction of IntlGregorianCalendarNikita Popov2020-08-261-0/+8
| |
* | Prevent double-construction of IntlRuleBasedBreakIteratorNikita Popov2020-08-261-0/+9
| |
* | Ensure RuleBasedBreakIterator constructor throws on failureNikita Popov2020-08-252-7/+4
| | | | | | | | | | Constructors must throw on failure indepdendent of the configured intl error mode.
* | Add many missing closing PHP tags to testsMáté Kocsis2020-08-09120-2/+120
| | | | | | | | Closes GH-5958
* | Warning to ValueError promotion in Intl extension Part 1George Peter Banyard2020-07-3114-251/+305
| | | | | | | | | | | | | | | | | | Affects: - IntlCalendar - IntlGregorianCalendar - IntlBreakIterator Closes GH-5669
* | Fix IntlGregorianCalendar constructor signatureNikita Popov2020-07-171-1/+1
| | | | | | | | | | Give these conversative UNKNOWN defaults and no types, as the overload is something of a mess.
* | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-1/+1
| | | | | | | | Closes GH-5590
* | Drop non-well numeric string in Intl testGeorge Peter Banyard2020-06-281-4/+0
| |
* | Improve type error messages when an object is givenMáté Kocsis2020-05-262-2/+2
| | | | | | | | | | | | | | From now on, we always display the given object's type instead of just reporting "object". Additionally, make the format of return type errors match the format of argument errors. Closes GH-5625
* | Deprecate old ReflectionParameter type declaration APIsNikita Popov2020-05-111-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates: ReflectionParameter::isArray() ReflectionParameter::isCallable() ReflectionParameter::getClass() These APIs have been superseded by ReflectionParameter::getType() since PHP 7.0. Types introduced since that time are not available through the old APIs, and their behavior is getting increasingly confusing. This is how they interact with PHP 8 union types: * isArray() will return true if the type is array or ?array, but not any other union type * Same for isCallable(). * getClass() will return a class for T|int etc, as long as the union only contains a single type. T1|T2 will return null. This behavior is not particularly reasonable or useful, and will get more confusing as new type system extensions are added. Closes GH-5209.
* | Make float to string casts locale-independentMáté Kocsis2020-05-082-2/+2
| | | | | | | | | | | | | | | | From now on, float to string casting will always behave locale-independently. RFC: https://wiki.php.net/rfc/locale_independent_float_to_string Closes GH-5224 Co-authored-by: George Peter Banyard <girgias@php.net>
* | Update intl test suite for ICU 67.1Christoph M. Becker2020-04-244-3/+469
| |
* | Add Intl resource bundle files for big-endian architecture.George Peter Banyard2020-04-148-1/+10
| | | | | | | | | | | | | | | | Little and Big endian files have their own designated folder. Both use the ASCII charset family. We may want to add a big-endian/EBCDIC charset family resource bundle in the future. The build script is currently left untouched as it seems to mostly be for Windows.
* | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-8/+8
| | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | Display nullability in type error messages for internal functionsMáté Kocsis2020-03-311-2/+2
| | | | | | | | Closes GH-5327
* | Change argument error message formatMáté Kocsis2020-02-2650-67/+67
| | | | | | | | Closes GH-5211
* | Make type error messages more consistentMáté Kocsis2020-02-1750-67/+67
| | | | | | | | Closes GH-5092
* | Constrain number parameter of numfmt_format to int|floatChristoph M. Becker2020-02-163-27/+12
| | | | | | | | | | | | | | | | | | | | | | This is inline with similar changes to the math functions. Especially, array to number conversion makes no sense here, and is likely to hide a programming error. To make that feasible, we introduce the `n` specifier for classic ZPP so we can stick with `zend_parse_method_parameters()`. We also remove a test case, which has been degenerated to a ZPP test.
* | Fix ZPP of intl_cal_set()Máté Kocsis2020-02-041-3/+14
| |
* | Add stubs for IntlDateFormatter & MessageFormatterMáté Kocsis2020-02-041-1/+1
| | | | | | | | Closes GH-4812
* | Reindent phpt filesNikita Popov2020-02-03155-3496/+3496
| |
* | Merge branch 'PHP-7.4'Christoph M. Becker2020-02-031-2/+2
|\ \ | |/ | | | | | | * PHP-7.4: Relax test expectation
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-02-031-2/+2
| |\ | | | | | | | | | | | | * PHP-7.3: Relax test expectation
| | * Relax test expectationChristoph M. Becker2020-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | Since we're dealing with floating point numbers, precision issues may hit us, and actually it's not necessary to check for the exact number anyway, because it is not exact in the first place. Therefore, we relax the test expectations.