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

1.1       misho       1: --TEST--
                      2: Bug #51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error)
                      3: --FILE--
                      4: <?php
                      5: date_default_timezone_set('UTC');
                      6: 
                      7: $aTzAbbr = timezone_abbreviations_list();
                      8: 
                      9: $aTz = array();
                     10: foreach (array_keys($aTzAbbr) as $sKey) {
                     11:     foreach (array_keys($aTzAbbr[$sKey]) as $iIndex) {
                     12:         $sTz = $aTzAbbr[$sKey][$iIndex]['timezone_id'];
                     13: 
                     14:         if (! in_array($sTz, $aTz)) {
                     15:             array_push($aTz, $sTz);
                     16:         }
                     17:     }
                     18: }
                     19: 
                     20: foreach ($aTz as $sTz) {
                     21:     $sDate = '2010-05-15 00:00:00 ' . $sTz;
                     22: 
                     23:     try {
                     24:         $oDateTime = new DateTime($sDate);
                     25:     } catch (Exception $oException) {
                     26:         var_dump($oException->getMessage());
                     27:         print_r(DateTime::getLastErrors());
                     28:     }
                     29: }
                     30: 
                     31: var_dump('this should be the only output');
                     32: ?>
                     33: --EXPECTF--
                     34: string(30) "this should be the only output"

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