summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/search
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /tests/phpunit/includes/search
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'tests/phpunit/includes/search')
-rw-r--r--tests/phpunit/includes/search/SearchEngineTest.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/phpunit/includes/search/SearchEngineTest.php b/tests/phpunit/includes/search/SearchEngineTest.php
index 1a0fcd31..957907c7 100644
--- a/tests/phpunit/includes/search/SearchEngineTest.php
+++ b/tests/phpunit/includes/search/SearchEngineTest.php
@@ -12,7 +12,7 @@ class SearchEngineTest extends MediaWikiTestCase {
unset( $this->search );
}
- /*
+ /**
* Checks for database type & version.
* Will skip current test if DB does not support search.
*/
@@ -64,8 +64,10 @@ class SearchEngineTest extends MediaWikiTestCase {
$this->assertTrue( is_object( $results ) );
$matches = array();
- while ( $row = $results->next() ) {
+ $row = $results->next();
+ while ( $row ) {
$matches[] = $row->getTitle()->getPrefixedText();
+ $row = $results->next();
}
$results->free();
# Search is not guaranteed to return results in a certain order;
@@ -83,20 +85,18 @@ class SearchEngineTest extends MediaWikiTestCase {
* @param $n Integer: unused
*/
function insertPage( $pageName, $text, $ns ) {
- $dbw = $this->db;
$title = Title::newFromText( $pageName );
$user = User::newFromName( 'WikiSysop' );
$comment = 'Search Test';
// avoid memory leak...?
- $linkCache = LinkCache::singleton();
- $linkCache->clear();
+ LinkCache::singleton()->clear();
- $article = new Article( $title );
- $article->doEdit( $text, $comment, 0, false, $user );
+ $page = WikiPage::factory( $title );
+ $page->doEdit( $text, $comment, 0, false, $user );
- $this->pageList[] = array( $title, $article->getId() );
+ $this->pageList[] = array( $title, $page->getId() );
return true;
}