* TODO: Still tracking down a bug with the tests+jobqueue that shows up during UploadFromURLTest.php
$wgUser = new User;
$wgUser->setId(1);
+ $wgUser->mDataLoaded = true;
$wgUser->setOption('variant', 'tg-latn');
$this->assertEquals('tg', $this->lc->getPreferredVariant(false, false));
}
/**
- * @expectedException
+ * @expectedException MWException
*/
function testInLanguageThrows() {
Message::key( 'foo' )->inLanguage( 123 );
}
class SearchUpdateTest extends PHPUnit_Framework_TestCase {
+ static $searchType;
+ static $dbtype;
+ static $factoryconf;
+ static $dbservers;
function update( $text, $title = 'Test', $id = 1 ) {
$u = new SearchUpdate( $id, $title, $text );
function setUp() {
global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers;
+
+ self::$searchType = $wgSearchType;
+ self::$dbtype = $wgDBtype;
+ self::$factoryconf = $wgLBFactoryConf;
+ self::$dbservers = $wgDBservers;
+
$wgSearchType = 'MockSearch';
$wgDBtype = 'mock';
$wgLBFactoryConf['class'] = 'LBFactory_Simple';
}
function tearDown() {
+ global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers;
+
LBFactory::destroyInstance();
+
+ $wgSearchType = self::$searchType;
+ $wgDBtype = self::$dbtype;
+ $wgLBFactoryConf = self::$factoryconf;
+ $wgDBservers = self::$dbservers;
}
function testUpdateText() {
<?php
class TimeAdjustTest extends PHPUnit_Framework_TestCase {
+ static $offset;
public function setUp() {
+ global $wgLocalTZoffset;
+ self::$offset = $wgLocalTZoffset;
+
$this->iniSet( 'precision', 15 );
}
+ public function tearDown() {
+ global $wgLocalTZoffset;
+ $wgLocalTZoffset = self::$offset;
+ }
+
# Test offset usage for a given language::userAdjust
function testUserAdjust() {
global $wgLocalTZoffset, $wgContLang, $wgUser;
define( 'MW_PHPUNIT_TEST', true );
require_once( "$IP/maintenance/commandLine.inc" );
+$wgLocaltimezone = 'UTC';
if( !version_compare(PHPUnit_Runner_Version::id(), "3.4.1", ">") ) {
echo <<<EOF
stopOnFailure="false">
<testsuite name="MediaWiki Test Suite">
<!-- <directory>.</directory> -->
- <file>ApiTest.php</file>
+ <!-- <file>ApiTest.php</file> -->
+ <!-- <file>ApiWatchTest.php</file> -->
+ <file>CdbTest.php</file>
+ <file>DatabaseSqliteTest.php</file>
+ <file>DatabaseTest.php</file>
+ <file>GlobalTest.php</file>
<file>HttpTest.php</file>
+ <file>IPTest.php</file>
+ <file>ImageFunctionsTest.php</file>
<file>LanguageConverterTest.php</file>
+ <file>LicensesTest.php</file>
<file>LocalFileTest.php</file>
<file>MediaWikiParserTest.php</file>
+ <file>MessageTest.php</file>
<file>RevisionTest.php</file>
+ <file>SanitizerTest.php</file>
<file>SearchDbTest.php</file>
+ <file>SearchEngineTest.php</file>
+ <file>SearchUpdateTest.php</file>
<file>SiteConfigurationTest.php</file>
<file>TimeAdjustTest.php</file>
+ <file>TitlePermissionTest.php</file>
<file>TitleTest.php</file>
<file>UploadTest.php</file>
+ <file>UploadFromUrlTest.php</file>
<file>XmlTest.php</file>
</testsuite>
<groups>