MediaWiki REL1_30
TimeAdjustTest.php
Go to the documentation of this file.
1<?php
2
4 protected function setUp() {
5 parent::setUp();
6 }
7
13 public function testUserAdjust( $date, $localTZoffset, $expected ) {
14 global $wgContLang;
15
16 $this->setMwGlobals( 'wgLocalTZoffset', $localTZoffset );
17
18 $this->assertEquals(
19 $expected,
20 strval( $wgContLang->userAdjust( $date, '' ) ),
21 "User adjust {$date} by {$localTZoffset} minutes should give {$expected}"
22 );
23 }
24
25 public static function dataUserAdjust() {
26 return [
27 [ '20061231235959', 0, '20061231235959' ],
28 [ '20061231235959', 5, '20070101000459' ],
29 [ '20061231235959', 15, '20070101001459' ],
30 [ '20061231235959', 60, '20070101005959' ],
31 [ '20061231235959', 90, '20070101012959' ],
32 [ '20061231235959', 120, '20070101015959' ],
33 [ '20061231235959', 540, '20070101085959' ],
34 [ '20061231235959', -5, '20061231235459' ],
35 [ '20061231235959', -30, '20061231232959' ],
36 [ '20061231235959', -60, '20061231225959' ],
37 ];
38 }
39}
Base class that store and restore the Language objects.
setMwGlobals( $pairs, $value=null)
Sets a global, maintaining a stashed version of the previous global to be restored in tearDown.
static dataUserAdjust()
testUserAdjust( $date, $localTZoffset, $expected)
Test offset usage for a given Language::userAdjust dataUserAdjust Language::userAdjust.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
Definition design.txt:57