1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Commit Graph

85 Commits

Author SHA1 Message Date
Máté Kocsis
c37a1cd650 Promote a few remaining errors in ext/standard
Closes GH-6110
2020-09-15 14:26:16 +02:00
Nikita Popov
7e339a335e Make null byte error a ValueError
Currently we treat paths with null bytes as a TypeError, which is
incorrect, and rather inconsistent, as we treat empty paths as
ValueError. We do this because the error is generated by zpp and
it's easier to always throw TypeError there.

This changes the zpp implementation to throw a TypeError only if
the type is actually wrong and throw ValueError for null bytes.
The error message is also split accordingly, to be more precise.

Closes GH-6094.
2020-09-08 15:23:23 +02:00
George Peter Banyard
4a438b4469 Warning to Error promotion in ext/standard
Those should be the last ones other than set(raw)cookie()

Closes GH-5814
2020-09-03 17:43:57 +02:00
Máté Kocsis
b5c7a83dca Remove unnecessary PHPDoc-alike blocks from tests
Closes GH-5759
2020-06-24 13:13:44 +02:00
Moni
c5d9736130 update node-fetch url 2020-05-31 12:23:28 +02:00
Nikita Popov
d6a19bae51 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
2020-03-25 10:51:32 +01:00
Nikita Popov
2b3b7f5cd9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
2020-03-25 10:51:23 +01:00
Christian Schneider
c0840fec9c Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
Closes GH-5292.
2020-03-25 10:50:35 +01:00
Máté Kocsis
bb6f374048 Improve argument error messages in ext/standard
Closes GH-5198
2020-03-18 19:56:10 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Nikita Popov
fb8ffda690 Merge branch 'PHP-7.4'
* PHP-7.4:
  Slightly increase tolerance in time_sleep_until() test
2020-01-03 16:49:42 +01:00
Nikita Popov
7f02b5fc47 Slightly increase tolerance in time_sleep_until() test
With the 1ms tolerance this still occasionally fails on macos.
I love macos. It always works and causes no problems at all.
2020-01-03 16:49:15 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Nikita Popov
34ea5b0585 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove bogus skipifs in get_browser tests
2019-11-06 17:50:20 +01:00
Nikita Popov
f494a36618 Remove bogus skipifs in get_browser tests
We provide this file, it should be readable.

These checks no longer work, since --INI-- values are no longer
passed to --SKIPIF--.
2019-11-06 17:48:52 +01:00
Máté Kocsis
f19950fea0 Promote some warnings to exceptions in standard lib
Closes GH-4879.
2019-11-01 17:07:51 +01:00
Nikita Popov
e73cc44021 Merge branch 'PHP-7.4' 2019-07-01 09:44:53 +02:00
Nikita Popov
5c0a9a4096 Add some tolerance to time_sleep_until() test
This has been sporadically failing on macos for a while. We've tried
a couple of things (using int arithmetic, normalizing to gettimeofday),
but this issue remains. I'm adding some tolerance to the test to
avoid CI failures.
2019-07-01 09:43:16 +02:00
Nikita Popov
98d05389a7 Merge branch 'PHP-7.4' 2019-06-22 10:20:12 +02:00
Nikita Popov
df27bfe58b Add debugging code to time_sleep_until test 2019-06-22 10:19:49 +02:00
Joe Watkins
3d759e11a0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use uint64_t for time_sleep_until calculations
2019-06-16 19:20:37 +02:00
Nikita Popov
4befe320e3 Use uint64_t for time_sleep_until calculations 2019-06-16 19:20:08 +02:00
Joe Watkins
d7cf5d1eee Merge branch 'PHP-7.4'
* PHP-7.4:
  gettimeofday cannot be used to reliably implement high precision process synchronization
2019-06-16 07:18:17 +02:00
Joe Watkins
7e1972796b gettimeofday cannot be used to reliably implement high precision process synchronization
The use of gettimeofday in time_sleep_until is technically incorrect, it's not possible
to use gettimeofday in this way reliably on any platform: It relies on operating system
global structures, which may be modified by any other process on the system at any time.

While in practice, users may be ignoring this flaw, it entirely depends on the other software
running on the system to which the application is deployed, there is no possible way to write
a test that will always pass on any system, therefore it must be marked XFAIL.
2019-06-16 07:02:28 +02:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Nikita Popov
2580a7ba09 More zpp error/variation test removals 2019-03-07 17:09:43 +01:00
Gabriel Caruso
04723f2101 Make more tests run os MacOS 2019-01-22 19:17:27 -02:00
Nikita Popov
b1deb98c42 Fixed bug #77338
Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These
options are intended to be passed to pcre2_match. However, we do
not have any flags that actually need to be set during matching
(all relevant flags are set during compilation), and the preg_flags
value is used for PHP-specific flags instead.

This parameter should be removed entirely in master to avoid confusion.
2018-12-26 17:11:27 +01:00
Nikita Popov
69f54dd549 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-23 20:20:53 +01:00
Nikita Popov
64de5bc224 Fix invalid efree in browscap
Related to bug #77338.
2018-12-23 20:20:04 +01:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:55:24 +02:00
Peter Kokot
60a69daec6 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:54:08 +02:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Nikita Popov
47669aa784 Merge branch 'PHP-7.1' 2017-01-02 23:44:07 +01:00
Nikita Popov
76a1d3f153 Add get_browser() test against larger corpus
Testing corpus provided by Anatol against current browscap.ini lite.

About 30% of all agents are not recognized by this browscap.ini,
but this should give us decent coverage.
2017-01-02 23:30:27 +01:00
Nikita Popov
5c22579faf Merge branch 'PHP-7.1' 2016-12-18 14:58:49 +01:00
Nikita Popov
eb636fcb56 Add test for get_browser() in object mode
All other tests only check array return values...
2016-12-18 13:16:25 +01:00
Anatol Belski
5a0e0e2d8c Merge branch 'PHP-7.1'
* PHP-7.1:
  make timing check more forgiving in these tests
2016-12-15 12:33:13 +01:00
Anatol Belski
8bc3f179ce make timing check more forgiving in these tests
Particularly on slower VMs, the sporadic fails can still happen.
The timing is kept in an uncritical range, but allows the tests
pass there. Mayby, it'd make sense to introduce a new group for
this kind of tests, so tests requiring exact time measurement
can be avoided on unsuitable environments.
2016-12-15 12:20:37 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Christoph M. Becker
8fcfacf746 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-27 01:18:10 +02:00
Christoph M. Becker
2139918ea6 Fix #65550: get_browser() incorrectly parsers entries with "+" sign
+ signs in the browscap patterns are meant to be literal characters, so we
have to escape them for the regex matching.
2016-08-27 01:12:01 +02:00
Xinchen Hui
550bbf8f46 Fixed bug #69983 (get_browser fails with user agent of null) 2015-07-04 11:05:50 +08:00
Stanislav Malyshev
28fdf6a131 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed #68021 - get_browser() browser_name_regex
2015-03-22 22:13:21 -07:00
Tjerk Meesters
5b5742c016 Fixed #68021 - get_browser() browser_name_regex
Replaced expression delimiter with tilde (~) and escape where necessary.
2015-03-22 22:12:26 -07:00