Skip to content

Commit 082f7c9

Browse files
committed
Merge branch 'master' into jit-dynasm
* master: EXPECT instead of EXPECTF Fixed: tests not written to pass on Windows cli_get_process_title() may not be empty before set Not skipping test on Windows and test against CLI instead Added: tests for cli_get_process_title / cli_set_process_title Do the revert properly, and put back fraction support in 7.1 Fixed 32-bit tests as well. Revert "Upgrade timelib to 2017.05beta7" Revert "Remove removed header files from configuration files." Fixed stupid test Added timelib version to phpinfo()
2 parents d463fc1 + 21cd57e commit 082f7c9

File tree

8 files changed

+93
-19
lines changed

8 files changed

+93
-19
lines changed

ext/date/php_date.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ PHP_MINFO_FUNCTION(date)
922922

923923
php_info_print_table_start();
924924
php_info_print_table_row(2, "date/time support", "enabled");
925+
php_info_print_table_row(2, "timelib version", TIMELIB_ASCII_VERSION);
925926
php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
926927
php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
927928
php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));

ext/date/tests/date_sunrise_variation2.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Warning: date_sunrise() expects parameter 2 to be integer, float given in %s on
125125
bool(false)
126126

127127
--float .5--
128-
int(1218174483)
128+
int(1218174468)
129129

130130
--empty array--
131131

@@ -148,22 +148,22 @@ Warning: date_sunrise() expects parameter 2 to be integer, array given in %s on
148148
bool(false)
149149

150150
--uppercase NULL--
151-
int(1218174483)
151+
int(1218174468)
152152

153153
--lowercase null--
154-
int(1218174483)
154+
int(1218174468)
155155

156156
--lowercase true--
157-
string(5) "06:48"
157+
string(5) "06:47"
158158

159159
--lowercase false--
160-
int(1218174483)
160+
int(1218174468)
161161

162162
--uppercase TRUE--
163-
string(5) "06:48"
163+
string(5) "06:47"
164164

165165
--uppercase FALSE--
166-
int(1218174483)
166+
int(1218174468)
167167

168168
--empty string DQ--
169169

@@ -206,8 +206,8 @@ Warning: date_sunrise() expects parameter 2 to be integer, object given in %s on
206206
bool(false)
207207

208208
--undefined var--
209-
int(1218174483)
209+
int(1218174468)
210210

211211
--unset var--
212-
int(1218174483)
212+
int(1218174468)
213213
===DONE===

ext/date/tests/date_sunset_variation2.phpt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Warning: date_sunset() expects parameter 2 to be integer, float given in %s on l
125125
bool(false)
126126

127127
--float .5--
128-
int(1218199253)
128+
int(1218199264)
129129

130130
--empty array--
131131

@@ -148,22 +148,22 @@ Warning: date_sunset() expects parameter 2 to be integer, array given in %s on l
148148
bool(false)
149149

150150
--uppercase NULL--
151-
int(1218199253)
151+
int(1218199264)
152152

153153
--lowercase null--
154-
int(1218199253)
154+
int(1218199264)
155155

156156
--lowercase true--
157-
string(5) "18:10"
157+
string(5) "18:11"
158158

159159
--lowercase false--
160-
int(1218199253)
160+
int(1218199264)
161161

162162
--uppercase TRUE--
163-
string(5) "18:10"
163+
string(5) "18:11"
164164

165165
--uppercase FALSE--
166-
int(1218199253)
166+
int(1218199264)
167167

168168
--empty string DQ--
169169

@@ -206,8 +206,8 @@ Warning: date_sunset() expects parameter 2 to be integer, object given in %s on
206206
bool(false)
207207

208208
--undefined var--
209-
int(1218199253)
209+
int(1218199264)
210210

211211
--unset var--
212-
int(1218199253)
213-
===DONE===
212+
int(1218199264)
213+
===DONE===

ext/reflection/tests/026.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Version => %s
2020
date
2121

2222
date/time support => enabled
23+
timelib version => %s
2324
"Olson" Timezone Database Version => %s
2425
Timezone Database => %s
2526
Default timezone => %s
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
cli_get_process_title() function : basic functionality
3+
--CREDITS--
4+
Patrick Allaert patrickallaert@php.net
5+
@nephp #nephp17
6+
--SKIPIF--
7+
<?php
8+
if (PHP_SAPI !== "cli")
9+
die("skip");
10+
?>
11+
--FILE--
12+
<?php
13+
if (cli_set_process_title("title") && cli_get_process_title() === "title")
14+
echo "Title correctly retrieved!\n";
15+
16+
?>
17+
--EXPECT--
18+
Title correctly retrieved!
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
cli_get_process_title() function : error conditions
3+
--CREDITS--
4+
Patrick Allaert patrickallaert@php.net
5+
@nephp #nephp17
6+
--SKIPIF--
7+
<?php
8+
if (PHP_SAPI !== "cli")
9+
die("skip");
10+
?>
11+
--FILE--
12+
<?php
13+
cli_get_process_title("foo");
14+
?>
15+
--EXPECTF--
16+
Warning: cli_get_process_title() expects exactly 0 parameters, 1 given in %scli_get_process_title_error.php on line 2
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
cli_set_process_title() function : basic functionality
3+
--CREDITS--
4+
Patrick Allaert patrickallaert@php.net
5+
@nephp #nephp17
6+
--SKIPIF--
7+
<?php
8+
if (PHP_SAPI !== "cli")
9+
die("skip");
10+
?>
11+
--FILE--
12+
<?php
13+
if (cli_set_process_title("title") === true &&
14+
cli_get_process_title() === "title")
15+
echo "Successfully set title\n";
16+
17+
?>
18+
--EXPECT--
19+
Successfully set title
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
cli_set_process_title() function : error conditions
3+
--CREDITS--
4+
Patrick Allaert patrickallaert@php.net
5+
@nephp #nephp17
6+
--SKIPIF--
7+
<?php
8+
if (PHP_SAPI !== "cli")
9+
die("skip");
10+
?>
11+
--FILE--
12+
<?php
13+
cli_set_process_title();
14+
cli_set_process_title("foo", "bar");
15+
?>
16+
--EXPECTF--
17+
Warning: cli_set_process_title() expects exactly 1 parameter, 0 given in %scli_set_process_title_error.php on line 2
18+
19+
Warning: cli_set_process_title() expects exactly 1 parameter, 2 given in %scli_set_process_title_error.php on line 3

0 commit comments

Comments
 (0)