Annotation of embedaddon/php/ext/date/tests/date_create_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test date_create() function : basic functionality 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : DateTime date_create  ([ string $time  [, DateTimeZone $timezone  ]] )
                      6:  * Description: Returns new DateTime object
                      7:  * Source code: ext/date/php_date.c
                      8:  * Alias to functions: DateTime::__construct
                      9:  */
                     10: 
                     11: //Set the default time zone 
                     12: date_default_timezone_set("Europe/London");
                     13: 
                     14: echo "*** Testing date_create() : basic functionality ***\n";
                     15: 
                     16: var_dump( date_create() );
                     17: 
                     18: var_dump( date_create("GMT") );
                     19: var_dump( date_create("2005-07-14 22:30:41") );
                     20: var_dump( date_create("2005-07-14 22:30:41 GMT") );
                     21: 
                     22: ?>
                     23: ===DONE===
                     24: --EXPECTF--
                     25: *** Testing date_create() : basic functionality ***
                     26: object(DateTime)#%d (3) {
                     27:   ["date"]=>
                     28:   string(19) "%s"
                     29:   ["timezone_type"]=>
                     30:   int(3)
                     31:   ["timezone"]=>
                     32:   string(13) "Europe/London"
                     33: }
                     34: object(DateTime)#%d (3) {
                     35:   ["date"]=>
                     36:   string(19) "%s"
                     37:   ["timezone_type"]=>
                     38:   int(2)
                     39:   ["timezone"]=>
                     40:   string(3) "GMT"
                     41: }
                     42: object(DateTime)#%d (3) {
                     43:   ["date"]=>
                     44:   string(19) "2005-07-14 22:30:41"
                     45:   ["timezone_type"]=>
                     46:   int(3)
                     47:   ["timezone"]=>
                     48:   string(13) "Europe/London"
                     49: }
                     50: object(DateTime)#%d (3) {
                     51:   ["date"]=>
                     52:   string(19) "2005-07-14 22:30:41"
                     53:   ["timezone_type"]=>
                     54:   int(2)
                     55:   ["timezone"]=>
                     56:   string(3) "GMT"
                     57: }
                     58: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>