From e929e800b5ce00dbdd8aa60fc7ca01e432a0ba1a Mon Sep 17 00:00:00 2001 From: Paul Tarjan Date: Wed, 19 Jun 2013 17:34:42 -0700 Subject: [PATCH] fix new php tests for open source This was a pretty bad import into open source :( https://travis-ci.org/facebook/hiphop-php/builds/8251282 * date tests assumed PDT. I tried putting `date_default_timezone_set("America/Los_Angeles");`. Lets see if that helps. * options test checked for `phpmcc` which is only a facebook thing * I'm not sure what is wrong with hash or network, but their output totally masks the real value. Made the tests output their value so I can at least test in prod. --- hphp/test/slow/ext_datetime/date.php | 77 ++++----- hphp/test/slow/ext_datetime/date.php.expect | 62 +++---- hphp/test/slow/ext_datetime/date_format.php | 6 +- .../slow/ext_datetime/date_format.php.expect | 4 +- hphp/test/slow/ext_datetime/date_sun_info.php | 2 + .../test/slow/ext_datetime/date_timestamp.php | 7 +- .../ext_datetime/date_timestamp.php.expect | 4 +- hphp/test/slow/ext_datetime/date_timezone.php | 35 ++-- .../ext_datetime/date_timezone.php.expect | 26 +-- hphp/test/slow/ext_datetime/gmfoo.php | 19 +-- hphp/test/slow/ext_datetime/gmfoo.php.expect | 17 +- hphp/test/slow/ext_datetime/localtime.php | 3 + hphp/test/slow/ext_datetime/strftime.php | 37 ++--- .../slow/ext_datetime/strftime.php.expect | 22 ++- hphp/test/slow/ext_datetime/strtotime.php | 21 +-- .../slow/ext_datetime/strtotime.php.expect | 16 +- hphp/test/slow/ext_hash/ext_hash.php | 155 +++++++----------- hphp/test/slow/ext_hash/ext_hash.php.expect | 77 +++++---- hphp/test/slow/ext_network/ext_network.php | 73 ++++----- .../slow/ext_network/ext_network.php.expect | Bin 363 -> 538 bytes hphp/test/slow/ext_options/ext_options.php | 1 - .../slow/ext_options/ext_options.php.expect | 1 - 22 files changed, 299 insertions(+), 366 deletions(-) diff --git a/hphp/test/slow/ext_datetime/date.php b/hphp/test/slow/ext_datetime/date.php index 06b787481..1a8e70711 100644 --- a/hphp/test/slow/ext_datetime/date.php +++ b/hphp/test/slow/ext_datetime/date.php @@ -1,98 +1,91 @@ 1073504408); var_dump(gettimeofday(true) > 1073504408.23910); @@ -101,4 +94,4 @@ $timestamp = strtotime("1st January 2004"); //1072915200 // this prints the year in a two digit format // however, as this would start with a "0", it // only prints "4" -VS(idate("y", $timestamp), 4); +var_dump(idate("y", $timestamp)); diff --git a/hphp/test/slow/ext_datetime/date.php.expect b/hphp/test/slow/ext_datetime/date.php.expect index b2cff208e..d6ec2393a 100644 --- a/hphp/test/slow/ext_datetime/date.php.expect +++ b/hphp/test/slow/ext_datetime/date.php.expect @@ -1,32 +1,32 @@ -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) +string(19) "2006-12-12 00:00:00" +string(19) "2007-02-01 00:00:01" +string(19) "2007-11-23 12:34:56" +string(19) "2007-08-29 00:00:00" +string(19) "2006-12-13 00:00:00" +int(-28800) +int(-25200) +string(19) "2006-12-12 23:45:12" +string(9) "Wednesday" +string(44) "Wednesday 10th of September 2008 12:34:56 PM" +string(8) "Saturday" +string(29) "Wed, 10 Sep 08 12:34:56 -0700" +string(25) "2000-07-01T00:00:00-07:00" +string(18) "Wednesday the 10th" +int(1221116400) +int(1218351600) +int(1252566000) +string(23) "March 10, 2001, 5:16 am" +string(8) "03.10.01" +string(11) "10, 3, 2001" +string(8) "20010310" +string(43) "05-16-18, 10-03-01, 1631 1618 6 Satam01 68 " +string(19) "it is the 10th day." +string(27) "Sat Mar 10 5:16:18 PST 2001" +string(19) "05:03:18 m is month" +string(8) "05:16:18" +string(8) "19550310" +string(31) "Tue, 23 Jul 1811 07:06:40 -0800" +int(1259308800) array(11) { ["seconds"]=> int(56) @@ -51,7 +51,7 @@ array(11) { [0]=> int(1221075296) } +int(4) bool(true) bool(true) -bool(true) -bool(true) +int(4) diff --git a/hphp/test/slow/ext_datetime/date_format.php b/hphp/test/slow/ext_datetime/date_format.php index 6853b0ee6..047fc6aac 100644 --- a/hphp/test/slow/ext_datetime/date_format.php +++ b/hphp/test/slow/ext_datetime/date_format.php @@ -1,5 +1,7 @@ 0); -VS(strtotime("10 September 2000"), 968569200); -VS(strtotime("+1 day", 968569200), 968655600); -VS(strtotime("+1 week", 968569200), 969174000); -VS(strtotime("+1 week 2 days 4 hours 2 seconds", 968569200), 969361202); -VS(strtotime("next Thursday", 968569200), 968914800); -VS(strtotime("last Monday", 968569200), 968050800); +var_dump(strtotime("10 September 2000")); +var_dump(strtotime("+1 day", 968569200)); +var_dump(strtotime("+1 week", 968569200)); +var_dump(strtotime("+1 week 2 days 4 hours 2 seconds", 968569200)); +var_dump(strtotime("next Thursday", 968569200)); +var_dump(strtotime("last Monday", 968569200)); $str = "Not Good"; $timestamp = strtotime($str); -VS($timestamp, false); -VS(strtotime(""), false); +var_dump($timestamp); +var_dump(strtotime("")); diff --git a/hphp/test/slow/ext_datetime/strtotime.php.expect b/hphp/test/slow/ext_datetime/strtotime.php.expect index 53973d643..1a45ad512 100644 --- a/hphp/test/slow/ext_datetime/strtotime.php.expect +++ b/hphp/test/slow/ext_datetime/strtotime.php.expect @@ -1,9 +1,9 @@ bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) +int(968569200) +int(968655600) +int(969174000) +int(969361202) +int(968914800) +int(968050800) +bool(false) +bool(false) diff --git a/hphp/test/slow/ext_hash/ext_hash.php b/hphp/test/slow/ext_hash/ext_hash.php index 6bda07da2..8fa5c3475 100644 --- a/hphp/test/slow/ext_hash/ext_hash.php +++ b/hphp/test/slow/ext_hash/ext_hash.php @@ -1,117 +1,82 @@ m?x+=Qv9#b)McVRMQpxpDM29sA`U2 r1K9-TH1Ghy>YR0vztFy6Lc<$5Ijs93cVs?8Zg*w5G~o6Jo*Y~NmzbJ9 literal 363 XcmYew&(F~)DJo6X