Annotation of embedaddon/php/ext/date/tests/date-time-modify-times.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test for DateTime::modify() with absolute time statements
                      3: --INI--
                      4: date.timezone=Europe/London
                      5: --FILE--
                      6: <?php
                      7: $tests = array(
                      8:        '2010-12-15 19:42:45 UTC' => array(
                      9:                'october 23:00', // October 23rd, with a broken time
                     10:                'back of 4pm',
                     11:                'next week monday',
                     12:                'next week monday 10am',
                     13:                'tuesday noon',
                     14:                'first monday of January 2011',
                     15:                'first monday of January 2011 09:00',
                     16:        ),
                     17:        '2010-12-15 19:42:45' => array(
                     18:                'october 23:00', // October 23rd, with a broken time
                     19:                'march 28, 00:15',
                     20:                'march 28, 01:15', // doesn't exist bcause of DST
                     21:                'march 28, 02:15',
                     22:        ),
                     23: );
                     24: 
                     25: foreach ( $tests as $start => $data )
                     26: {
                     27:        foreach ( $data as $test )
                     28:        {
                     29:                echo date_create( $start )
                     30:                        ->modify( $test )
                     31:                        ->format( DateTime::RFC2822 ), "\n";
                     32:        }
                     33: }
                     34: echo "\n";
                     35: ?>
                     36: --EXPECT--
                     37: Sat, 23 Oct 2010 00:00:00 +0000
                     38: Wed, 15 Dec 2010 16:15:00 +0000
                     39: Mon, 20 Dec 2010 00:00:00 +0000
                     40: Mon, 20 Dec 2010 10:00:00 +0000
                     41: Tue, 21 Dec 2010 12:00:00 +0000
                     42: Mon, 03 Jan 2011 00:00:00 +0000
                     43: Mon, 03 Jan 2011 09:00:00 +0000
                     44: Sat, 23 Oct 2010 00:00:00 +0100
                     45: Sun, 28 Mar 2010 00:15:00 +0000
                     46: Sun, 28 Mar 2010 02:15:00 +0100
                     47: Sun, 28 Mar 2010 02:15:00 +0100

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