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

1.1       misho       1: --TEST--
                      2: Test DateTime class inheritance : with user space __construct magic method
                      3: --FILE--
                      4: <?php
                      5: 
                      6: //Set the default time zone 
                      7: date_default_timezone_set("Europe/London");
                      8: 
                      9: echo "*** Testing new DateTime() : with user space __construct magic method ***\n";
                     10: 
                     11: class DateTimeExt extends DateTime
                     12: {
                     13:        public function __construct ($date = null, DateTimeZone  $dtz = null)
                     14:     {
                     15:         if($dtz === null)
                     16:         {
                     17:             $dtz = new DateTimeZone(date_default_timezone_get());
                     18:         }
                     19:         parent::__construct($date, $dtz);
                     20:     }
                     21: }
                     22: 
                     23: $d = new DateTimeExt("1967-05-01 22:30:41");
                     24: echo $d->format("F j, Y, g:i:s a") . "\n"; 
                     25: 
                     26: ?>
                     27: ===DONE===
                     28: --EXPECTF--
                     29: *** Testing new DateTime() : with user space __construct magic method ***
                     30: May 1, 1967, 10:30:41 pm
                     31: ===DONE===

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