'ExternalUser_vB' => 'includes/extauth/vB.php',
'FatalError' => 'includes/Exception.php',
'FakeTitle' => 'includes/FakeTitle.php',
+ 'FakeMemCachedClient' => 'includes/ObjectCache.php',
'FauxRequest' => 'includes/WebRequest.php',
'FeedItem' => 'includes/Feed.php',
'FeedUtils' => 'includes/FeedUtils.php',
NS_CATEGORY_TALK => 'Category_talk',
);
-if( is_array( $wgExtraNamespaces ) ) {
+if( isset( $wgExtraNamespaces ) && is_array( $wgExtraNamespaces ) ) {
$wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces;
}
<?php
+require 'ImageFunctions.php';
+
class ImageFunctionsTest extends PHPUnit_Framework_TestCase {
function testFitBoxWidth() {
$vals = array(
<?php
+require 'ProxyTools.php';
+
class LanguageConverterTest extends PHPUnit_Framework_TestCase {
protected $lang = null;
- protected $lc = null;
+ protected $lc = null;
function setUp() {
+ global $wgMemc;
+ $wgMemc = new FakeMemCachedClient;
$this->lang = new LanguageTest();
$this->lc = new TestConverter( $this->lang, 'tg',
array( 'tg', 'tg-latn' ) );
}
function tearDown() {
+ global $wgMemc;
+ unset($wgMemc);
unset($this->lc);
unset($this->lang);
}
/**
* These tests should work regardless of $wgCapitalLinks
- * @group Broken
*/
+require 'Namespace.php';
+
class LocalFileTest extends PHPUnit_Framework_TestCase {
function setUp() {
+ global $wgContLang;
+ $wgContLang = new Language;
$info = array(
'name' => 'test',
'directory' => '/testdir',
$this->file_lc = $this->repo_lc->newFile( 'test!' );
}
+ function tearDown() {
+ global $wgContLang;
+ unset($wgContLang);
+ }
+
function testGetHashPath() {
$this->assertEquals( '', $this->file_hl0->getHashPath() );
$this->assertEquals( 'a/a2/', $this->file_hl2->getHashPath() );
}
function testGetThumbVirtualUrl() {
- $this->assertEquals( 'mwrepo://test/public/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() );
- $this->assertEquals( 'mwrepo://test/public/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() );
- $this->assertEquals( 'mwrepo://test/public/thumb/Test%21/%21', $this->file_hl0->getThumbVirtualUrl( '!' ) );
- $this->assertEquals( 'mwrepo://test/public/thumb/a/a2/Test%21/%21', $this->file_hl2->getThumbVirtualUrl( '!' ) );
+ $this->assertEquals( 'mwrepo://test/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() );
+ $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() );
+ $this->assertEquals( 'mwrepo://test/thumb/Test%21/%21', $this->file_hl0->getThumbVirtualUrl( '!' ) );
+ $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21/%21', $this->file_hl2->getThumbVirtualUrl( '!' ) );
}
function testGetUrl() {
protected function buildTestDatabase( $tables ) {
global $testOptions, $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
$wgDBprefix = 'parsertest_';
+ $this->markTestIncomplete("This test requires DB admin user credentials.");
$db = new DatabaseMysql(
$wgDBserver,
$wgDBadminuser,
require_once 'MediaWiki_TestCase.php';
/** @todo document
- * @group Broken
*/
class SearchEngineTest extends MediaWiki_TestCase {
}
function testTextSearch() {
- $this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
- if( !is_null( $this->db ) ) {
- $this->assertEquals(
- array( 'Smithee' ),
- $this->fetchIds( $this->search->searchText( 'smithee' ) ),
- "Plain search failed" );
+ if( is_null( $this->db ) ) {
+ $this->markTestIncomplete( "Can't find a database to test with." );
}
+ $this->assertEquals(
+ array( 'Smithee' ),
+ $this->fetchIds( $this->search->searchText( 'smithee' ) ),
+ "Plain search failed" );
}
function testTextPowerSearch() {
- $this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
- if( !is_null( $this->db ) ) {
- $this->search->setNamespaces( array( 0, 1, 4 ) );
- $this->assertEquals(
- array(
- 'Smithee',
- 'Talk:Main Page',
- ),
- $this->fetchIds( $this->search->searchText( 'smithee' ) ),
- "Power search failed" );
+ if( is_null( $this->db ) ) {
+ $this->markTestIncomplete( "Can't find a database to test with." );
}
+ $this->search->setNamespaces( array( 0, 1, 4 ) );
+ $this->assertEquals(
+ array(
+ 'Smithee',
+ 'Talk:Main Page',
+ ),
+ $this->fetchIds( $this->search->searchText( 'smithee' ) ),
+ "Power search failed" );
}
function testTitleSearch() {
- $this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
- if( !is_null( $this->db ) ) {
- $this->assertEquals(
- array(
- 'Alan Smithee',
- 'Smithee',
- ),
- $this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
- "Title search failed" );
+ if( is_null( $this->db ) ) {
+ $this->markTestIncomplete( "Can't find a database to test with." );
}
+ $this->assertEquals(
+ array(
+ 'Alan Smithee',
+ 'Smithee',
+ ),
+ $this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
+ "Title search failed" );
}
function testTextTitlePowerSearch() {
- $this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
- if( !is_null( $this->db ) ) {
- $this->search->setNamespaces( array( 0, 1, 4 ) );
- $this->assertEquals(
- array(
- 'Alan Smithee',
- 'Smithee',
- 'Talk:Smithee',
- ),
- $this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
- "Title power search failed" );
+ if( is_null( $this->db ) ) {
+ $this->markTestIncomplete( "Can't find a database to test with." );
}
+ $this->search->setNamespaces( array( 0, 1, 4 ) );
+ $this->assertEquals(
+ array(
+ 'Alan Smithee',
+ 'Smithee',
+ 'Talk:Smithee',
+ ),
+ $this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
+ "Title power search failed" );
}
}
<?php
require_once( 'SearchEngineTest.php' );
-/**
- * @group Broken
- */
-
class SearchMySQL4Test extends SearchEngineTest {
var $db;
<?php
-global $wgCommandLineMode, $IP, $wgMemc;
+global $wgCommandLineMode, $IP;
$wgCommandLineMode = true;
+$IP = dirname( dirname( __FILE__ ) );
define('MEDIAWIKI', 1);
+ini_set( 'include_path', "$IP:" .ini_get( 'include_path' ) );
-require dirname( dirname( __FILE__ ) ).implode( DIRECTORY_SEPARATOR, array( "", "includes", "Defines.php" ) );
+require ( "$IP/includes/Defines.php" );
+require ( "$IP/includes/DefaultSettings.php" );
+require ( "$IP/LocalSettings.php" );
-require dirname( dirname( __FILE__ ) ).DIRECTORY_SEPARATOR."LocalSettings.php";
-
-require "ProfilerStub.php";
+require 'ProfilerStub.php';
require 'GlobalFunctions.php';
require 'Hooks.php';
-require "AutoLoader.php";
-require 'ProxyTools.php';
-require 'ObjectCache.php';
-require 'ImageFunctions.php';
-
-$wgMemc =& wfGetMainCache();
+require 'AutoLoader.php';