From f963c76dfab2e3897c1659e179773a5ac4eb95b6 Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 23 Nov 2017 19:11:25 +0000 Subject: [PATCH] Remove unused WikiPageTestContentHandlerUseDB (test) This class had the wrong name so has not been run since it was written in 2012. In If5b1fa39610dbe366649f79beda58f4ea6d58c8f I fixed the name but the tests fail, so lets just remove it and rewrite the tests. Change-Id: Iccdcd4a4f72c8b1329d36ff2e8699ba6b23c9ae7 --- .../page/WikiPageTestContentHandlerUseDB.php | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 tests/phpunit/includes/page/WikiPageTestContentHandlerUseDB.php diff --git a/tests/phpunit/includes/page/WikiPageTestContentHandlerUseDB.php b/tests/phpunit/includes/page/WikiPageTestContentHandlerUseDB.php deleted file mode 100644 index 3db7628090..0000000000 --- a/tests/phpunit/includes/page/WikiPageTestContentHandlerUseDB.php +++ /dev/null @@ -1,61 +0,0 @@ -setMwGlobals( 'wgContentHandlerUseDB', false ); - - $dbw = wfGetDB( DB_MASTER ); - - $page_table = $dbw->tableName( 'page' ); - $revision_table = $dbw->tableName( 'revision' ); - $archive_table = $dbw->tableName( 'archive' ); - - if ( $dbw->fieldExists( $page_table, 'page_content_model' ) ) { - $dbw->query( "alter table $page_table drop column page_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_format" ); - $dbw->query( "alter table $archive_table drop column ar_content_model" ); - $dbw->query( "alter table $archive_table drop column ar_content_format" ); - } - } - - /** - * @covers WikiPage::getContentModel - */ - public function testGetContentModel() { - $page = $this->createPage( - "WikiPageTest_testGetContentModel", - "some text", - CONTENT_MODEL_JAVASCRIPT - ); - - $page = new WikiPage( $page->getTitle() ); - - // NOTE: since the content model is not recorded in the database, - // we expect to get the default, namely CONTENT_MODEL_WIKITEXT - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $page->getContentModel() ); - } - - /** - * @covers WikiPage::getContentHandler - */ - public function testGetContentHandler() { - $page = $this->createPage( - "WikiPageTest_testGetContentHandler", - "some text", - CONTENT_MODEL_JAVASCRIPT - ); - - // NOTE: since the content model is not recorded in the database, - // we expect to get the default, namely CONTENT_MODEL_WIKITEXT - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( 'WikitextContentHandler', get_class( $page->getContentHandler() ) ); - } -} -- 2.20.1