Index: trunk/phase3/maintenance/tests/phpunit/includes/LocalFileTest.php |
— | — | @@ -25,11 +25,6 @@ |
26 | 26 | $this->file_lc = $this->repo_lc->newFile( 'test!' ); |
27 | 27 | } |
28 | 28 | |
29 | | - function tearDown() { |
30 | | - global $wgContLang; |
31 | | - unset( $wgContLang ); |
32 | | - } |
33 | | - |
34 | 29 | function testGetHashPath() { |
35 | 30 | $this->assertEquals( '', $this->file_hl0->getHashPath() ); |
36 | 31 | $this->assertEquals( 'a/a2/', $this->file_hl2->getHashPath() ); |
Index: trunk/phase3/maintenance/tests/phpunit/includes/search/SearchDbTest.php |
— | — | @@ -31,7 +31,6 @@ |
32 | 32 | function tearDown() { |
33 | 33 | $this->removeSearchData(); |
34 | 34 | unset( $this->search ); |
35 | | - $GLOBALS['wgContLang'] = null; |
36 | 35 | } |
37 | 36 | } |
38 | 37 | |
Index: trunk/phase3/maintenance/tests/phpunit/includes/search/SearchUpdateTest.php |
— | — | @@ -1,33 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -class DatabaseMock extends DatabaseBase { |
5 | | - function __construct( $server = false, $user = false, $password = false, $dbName = false, |
6 | | - $flags = 0, $tablePrefix = 'get from global' ) |
7 | | - { |
8 | | - $this->mConn = true; |
9 | | - $this->mOpened = true; |
10 | | - } |
11 | | - |
12 | | - function open( $server, $user, $password, $dbName ) { return true; } |
13 | | - function doQuery( $sql ) { } |
14 | | - function fetchObject( $res ) { } |
15 | | - function fetchRow( $res ) { } |
16 | | - function numRows( $res ) { } |
17 | | - function numFields( $res ) { } |
18 | | - function fieldName( $res, $n ) { } |
19 | | - function insertId() { } |
20 | | - function dataSeek( $res, $row ) { } |
21 | | - function lastErrno() { return 0; } |
22 | | - function lastError() { return ''; } |
23 | | - function affectedRows() { } |
24 | | - function fieldInfo( $table, $field ) { } |
25 | | - function strencode( $s ) { } |
26 | | - static function getSoftwareLink() { } |
27 | | - function getServerVersion() { } |
28 | | - function getType() { } |
29 | | - function getSearchEngine() { } |
30 | | -} |
31 | | - |
32 | 4 | class MockSearch extends SearchEngine { |
33 | 5 | public static $id; |
34 | 6 | public static $title; |
— | — | @@ -44,15 +16,11 @@ |
45 | 17 | } |
46 | 18 | |
47 | 19 | /** |
48 | | - * @group Broken |
49 | 20 | * Disabled until we're able to run it without messing with LoadBalancer and breaking |
50 | 21 | * other tests in a sneaky way |
51 | 22 | */ |
52 | 23 | class SearchUpdateTest extends PHPUnit_Framework_TestCase { |
53 | 24 | static $searchType; |
54 | | - static $dbtype; |
55 | | - static $factoryconf; |
56 | | - static $dbservers; |
57 | 25 | |
58 | 26 | function update( $text, $title = 'Test', $id = 1 ) { |
59 | 27 | $u = new SearchUpdate( $id, $title, $text ); |
— | — | @@ -67,32 +35,16 @@ |
68 | 36 | } |
69 | 37 | |
70 | 38 | function setUp() { |
71 | | - global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers, $wgContLang; |
| 39 | + global $wgSearchType; |
72 | 40 | |
73 | 41 | self::$searchType = $wgSearchType; |
74 | | - self::$dbtype = $wgDBtype; |
75 | | - self::$factoryconf = $wgLBFactoryConf; |
76 | | - self::$dbservers = $wgDBservers; |
77 | | - |
78 | 42 | $wgSearchType = 'MockSearch'; |
79 | | - $wgDBtype = 'mock'; |
80 | | - $wgLBFactoryConf['class'] = 'LBFactory_Simple'; |
81 | | - $wgDBservers = null; |
82 | | - |
83 | | - # We need to reset the LoadBalancer in order to bypass its cache and get the mock db |
84 | | - wfGetLBFactory()->destroyInstance(); |
85 | | - $wgContLang = Language::factory( 'en' ); |
86 | 43 | } |
87 | 44 | |
88 | 45 | function tearDown() { |
89 | | - global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers, $wgContLang; |
| 46 | + global $wgSearchType; |
90 | 47 | |
91 | 48 | $wgSearchType = self::$searchType; |
92 | | - $wgDBtype = self::$dbtype; |
93 | | - $wgLBFactoryConf = self::$factoryconf; |
94 | | - $wgDBservers = self::$dbservers; |
95 | | - |
96 | | - wfGetLBFactory()->destroyInstance(); |
97 | 49 | } |
98 | 50 | |
99 | 51 | function testUpdateText() { |