test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / includes / TimeAdjustTest.php
blob3a2c62a41bd2001e2323f336519c28af86109b96
1 <?php
3 class TimeAdjustTest extends MediaWikiLangTestCase {
4 protected function setUp() {
5 parent::setUp();
7 $this->iniSet( 'precision', 15 );
10 /**
11 * Test offset usage for a given language::userAdjust
12 * @dataProvider dataUserAdjust
14 public function testUserAdjust( $date, $localTZoffset, $expected ) {
15 global $wgContLang;
17 $this->setMwGlobals( 'wgLocalTZoffset', $localTZoffset );
19 $this->assertEquals(
20 strval( $expected ),
21 strval( $wgContLang->userAdjust( $date, '' ) ),
22 "User adjust {$date} by {$localTZoffset} minutes should give {$expected}"
26 public static function dataUserAdjust() {
27 return array(
28 array( 20061231235959, 0, 20061231235959 ),
29 array( 20061231235959, 5, 20070101000459 ),
30 array( 20061231235959, 15, 20070101001459 ),
31 array( 20061231235959, 60, 20070101005959 ),
32 array( 20061231235959, 90, 20070101012959 ),
33 array( 20061231235959, 120, 20070101015959 ),
34 array( 20061231235959, 540, 20070101085959 ),
35 array( 20061231235959, -5, 20061231235459 ),
36 array( 20061231235959, -30, 20061231232959 ),
37 array( 20061231235959, -60, 20061231225959 ),