1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00

Adding a new test for the new method

This commit is contained in:
Trevor Suarez
2015-03-05 02:02:50 -05:00
parent 42660f3d6a
commit 46f22acdcd
@@ -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