com php-src: Adding a new test for the new method: ext/date/tes ts/DateTime_createFromImmutable.phpt

From: Date: Thu, 05 Mar 2015 07:02:50 +0000
Subject: com php-src: Adding a new test for the new method: ext/date/tes ts/DateTime_createFromImmutable.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85795@lists.php.net to get a copy of this message
Commit: 46f22acdcdc5b5c6dbc5432efb2d0aed47df1820 Author: Trevor Suarez <rican7@gmail.com> Thu, 5 Mar 2015 02:02:50 -0500 Parents: 42660f3d6a7adf1852fc3a77fb17cecef99f9fd1 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=46f22acdcdc5b5c6dbc5432efb2d0aed47df1820 Log: Adding a new test for the new method Changed paths: A ext/date/tests/DateTime_createFromImmutable.phpt Diff: diff --git a/ext/date/tests/DateTime_createFromImmutable.phpt b/ext/date/tests/DateTime_createFromImmutable.phpt new file mode 100644 index 0000000..76731b1 --- /dev/null +++ b/ext/date/tests/DateTime_createFromImmutable.phpt @@ -0,0 +1,26 @@ +--TEST-- +Tests for DateTime::createFromImmutable. +--INI-- +date.timezone=America/New_York +--FILE-- +<?php +$current = "2015-03-05 07:00:16"; + +$i = DateTime::createFromImmutable(date_create_immutable($current)); +var_dump($i); + +$i = DateTime::createFromImmutable(date_create($current)); +var_dump($i); +?> +--EXPECTF-- +object(DateTime)#%d (3) { + ["date"]=> + string(26) "2015-03-05 07:00:16.000000" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(13) "America/New_York" +} + +Warning: DateTime::createFromImmutable() expects parameter 1 to be DateTimeImmutable, object given in %stests%eDateTime_createFromImmutable.php on line %d +NULL

« previous php.cvs (#85795) next »