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:
@@ -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
|
||||
Reference in New Issue
Block a user