Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
3
// CVS: $Id: bug-967.phpt,v 1.1 2006/11/20 09:07:18 firman Exp $
4
?>
5
--TEST--
6
Bug #967: Date_TimeZone uses a bad global variable
7
--FILE--
8
<?php
9
/**
10
 * Test for: Date_TimeZone
11
 * Parts tested: Date_TimeZone::setDefault() and Date_TimeZone::getDefault()
12
 */
13
 
14
require_once 'Date/TimeZone.php';
15
 
16
// Sets default timezone via a global variable.
17
$_DATE_TIMEZONE_DEFAULT = 'Pacific/Chatham';
18
$tz = Date_TimeZone::getDefault();
19
echo 'Date_TimeZone::$id = ' . $tz->id . "\n";
20
 
21
// Sets default timezone via Date_TimeZone::setDefault().
22
Date_TimeZone::setDefault('CST');
23
$default = 'EST';
24
$tz = Date_TimeZone::getDefault();
25
echo 'Date_TimeZone::$id = ' . $tz->id . "\n";
26
echo '$GLOBALS[\'_DATE_TIMEZONE_DEFAULT\'] = ' . $_DATE_TIMEZONE_DEFAULT . "\n";
27
?>
28
--EXPECT--
29
Date_TimeZone::$id = Pacific/Chatham
30
Date_TimeZone::$id = CST
31
$GLOBALS['_DATE_TIMEZONE_DEFAULT'] = CST
32
<?php
33
/*
34
 * Local variables:
35
 * mode: php
36
 * tab-width: 4
37
 * c-basic-offset: 4
38
 * c-hanging-comment-ender-p: nil
39
 * End:
40
 */
41
?>