Annotation of embedaddon/php/ext/date/tests/date_date_set_basic1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test date_date_set() function : basic functionality
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : DateTime date_date_set ( DateTime $object , int $year , int $month , int $day )
! 6: * Description: Resets the current date of the DateTime object to a different date.
! 7: * Source code: ext/date/php_date.c
! 8: * Alias to functions: DateTime::setDate
! 9: */
! 10:
! 11: //Set the default time zone
! 12: date_default_timezone_set("Europe/London");
! 13:
! 14: echo "*** Testing date_date_set() : basic functionality ***\n";
! 15:
! 16: $datetime = date_create("2009-01-30 19:34:10");
! 17:
! 18: echo date_format($datetime, DATE_RFC2822) . "\n";
! 19:
! 20: date_date_set($datetime, 2008, 02, 01);
! 21:
! 22: echo date_format($datetime, DATE_RFC2822) . "\n";
! 23:
! 24: ?>
! 25: ===DONE===
! 26: --EXPECTF--
! 27: *** Testing date_date_set() : basic functionality ***
! 28: Fri, 30 Jan 2009 19:34:10 +0000
! 29: Fri, 01 Feb 2008 19:34:10 +0000
! 30: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>