summaryrefslogtreecommitdiff
path: root/t/inc/Language.t
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-08-15 01:29:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2008-08-15 01:29:47 +0200
commit370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch)
tree491674f4c242e4d6ba0d04eafa305174c35a3391 /t/inc/Language.t
parentf4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff)
Update auf 1.13.0
Diffstat (limited to 't/inc/Language.t')
-rw-r--r--t/inc/Language.t30
1 files changed, 13 insertions, 17 deletions
diff --git a/t/inc/Language.t b/t/inc/Language.t
index df5e491d..125d67c1 100644
--- a/t/inc/Language.t
+++ b/t/inc/Language.t
@@ -1,18 +1,18 @@
#!/usr/bin/env php
<?php
-require 'Test.php';
+require 't/Test.php';
# Test offset usage for a given language::userAdjust
-function test_userAdjust( $langObj, $date, $offset, $expected ) {
+function test_userAdjust( &$langObj, $date, $offset, $expected ) {
global $wgLocalTZoffset;
$wgLocalTZoffset = $offset;
cmp_ok(
- $langObj->userAdjust( $date, '' ),
+ strval( $langObj->userAdjust( $date, '' ) ),
'==',
- $expected,
- "User adjust $date by $offset minutes should give $expected"
+ strval( $expected ),
+ "User adjust {$date} by {$offset} minutes should give {$expected}"
);
}
@@ -31,25 +31,22 @@ $userAdjust_tests = array(
array( 20061231235959, -60, 20061231225959 ),
);
-plan( 7 + count($userAdjust_tests) );
+plan( count($userAdjust_tests) );
+define( 'MEDIAWIKI', 1 );
-require_ok( 'includes/Defines.php' );
+# Don't use require_ok as these files need global variables
+
+require 'includes/Defines.php';
+require 'includes/ProfilerStub.php';
-# require_ok() doesn't work for these, find out why
-define( 'MEDIAWIKI', 1 );
require 'LocalSettings.php';
require 'includes/DefaultSettings.php';
+require 'includes/Setup.php';
+
# Create a language object
-require_ok( 'languages/Language.php' );
-require_ok( 'includes/Title.php' );
$wgContLang = $en = Language::factory( 'en' );
-# We need an user to test the lang
-require_ok( 'includes/GlobalFunctions.php' );
-require_ok( 'includes/ProfilerStub.php' );
-require_ok( 'includes/Exception.php' );
-require_ok( 'includes/User.php' );
global $wgUser;
$wgUser = new User();
@@ -59,4 +56,3 @@ foreach( $userAdjust_tests as $data ) {
}
/* vim: set filetype=php: */
-?>