phpt script need updating: ext/date/tests/oo_002.phpt
| From: | Joseph North | Date: | Sat, 08 Mar 2008 11:58:04 +0000 |
| Subject: | phpt script need updating: ext/date/tests/oo_002.phpt | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-64077@lists.php.net to get a copy of this message | ||
I just compiled PHP5.2.5, and the phpt script
date OO cloning [ext/date/tests/oo_002.phpt]
failed after running "make test" with the following output:
================================================================================
/home/sublick/apps/src/php-5.2.5/ext/date/tests/oo_002.phpt
================================================================================
string(29) "Fri, 01 Aug 08 13:00:00 +0000"
string(29) "Fri, 01 Aug 08 13:00:00 +0000"
string(29) "Fri, 01 Aug 08 14:00:00 +0000"
string(29) "Fri, 01 Aug 08 12:59:59 +0000"
string(10) "Asia/Tokyo"
string(10) "Asia/Tokyo"
================================================================================
001+ string(29) "Fri, 01 Aug 08 13:00:00 +0000"
002+ string(29) "Fri, 01 Aug 08 13:00:00 +0000"
003+ string(29) "Fri, 01 Aug 08 14:00:00 +0000"
004+ string(29) "Fri, 01 Aug 08 12:59:59 +0000"
001- string(29) "Wed, 01 Aug 07 13:00:00 +0000"
002- string(29) "Wed, 01 Aug 07 13:00:00 +0000"
003- string(29) "Wed, 01 Aug 07 14:00:00 +0000"
004- string(29) "Wed, 01 Aug 07 12:59:59 +0000"
================================================================================
I believe that the test needs to be updated in one of two ways:
1) Change the --EXPECT-- to match the 2008 dates, or
2) Change the string that is used to create the date so that it
includes 2007 as the year.
Here is a diff with the 2nd update:
9c9
< $d = new _d("1pm Aug 1 2007 GMT");
---
> $d = new _d("1pm Aug 1 GMT");
And here is the complete updated phpt file:
--TEST--
date OO cloning
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
class _d extends DateTime {}
class _t extends DateTimeZone {}
$d = new _d("1pm Aug 1 2007 GMT");
var_dump($d->format(DateTime::RFC822));
$c = clone $d;
var_dump($c->format(DateTime::RFC822));
$d->modify("1 hour after");
$c->modify("1 second ago");
var_dump($d->format(DateTime::RFC822));
var_dump($c->format(DateTime::RFC822));
$t = new _t("Asia/Tokyo");
var_dump($t->getName());
$c = clone $t;
var_dump($c->getName());
?>
--EXPECT--
string(29) "Wed, 01 Aug 07 13:00:00 +0000"
string(29) "Wed, 01 Aug 07 13:00:00 +0000"
string(29) "Wed, 01 Aug 07 14:00:00 +0000"
string(29) "Wed, 01 Aug 07 12:59:59 +0000"
string(10) "Asia/Tokyo"
string(10) "Asia/Tokyo"
Let me know if you need more information, or if somethings wrong on my end,
Joseph North