Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / tests / phpunit / includes / WikiPageTest.php
index 88c26ef..c8606cc 100644 (file)
@@ -4,7 +4,7 @@
 * ^--- important, causes temporary tables to be used instead of the real database
 **/
 
-class WikiPageTest extends MediaWikiTestCase {
+class WikiPageTest extends MediaWikiLangTestCase {
 
        var $pages_to_delete;
 
@@ -30,6 +30,7 @@ class WikiPageTest extends MediaWikiTestCase {
        }
 
        public function setUp() {
+               parent::setUp();
                $this->pages_to_delete = array();
        }
 
@@ -45,6 +46,7 @@ class WikiPageTest extends MediaWikiTestCase {
                                // fail silently
                        }
                }
+               parent::tearDown();
        }
 
        protected function newPage( $title ) {
@@ -142,6 +144,21 @@ class WikiPageTest extends MediaWikiTestCase {
                $this->assertEquals( 0, $n, 'pagelinks should contain no more links from the page' );
        }
 
+       public function testDoDeleteUpdates() {
+               $page = $this->createPage( "WikiPageTest_testDoDeleteArticle", "[[original text]] foo" );
+               $id = $page->getId();
+
+               $page->doDeleteUpdates( $id );
+
+               # ------------------------
+               $dbr = wfGetDB( DB_SLAVE );
+               $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) );
+               $n = $res->numRows();
+               $res->free();
+
+               $this->assertEquals( 0, $n, 'pagelinks should contain no more links from the page' );
+       }
+
        public function testGetRevision() {
                $page = $this->newPage( "WikiPageTest_testGetRevision" );