From 2e44b49a2db3026050b136de9b00f749dd3ff939 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 25 Apr 2014 06:26:49 +0200 Subject: Update to MediaWiki 1.22.6 --- .../RevisionStorageTest_ContentHandlerUseDB.php | 81 ---------------------- 1 file changed, 81 deletions(-) delete mode 100644 tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php (limited to 'tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php') diff --git a/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php b/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php deleted file mode 100644 index 4e83e355..00000000 --- a/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php +++ /dev/null @@ -1,81 +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" ); - } - - parent::setUp(); - } - - /** - * @covers Revision::selectFields - */ - public function testSelectFields() { - $fields = Revision::selectFields(); - - $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' ); - $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' ); - $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' ); - $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' ); - - $this->assertFalse( in_array( 'rev_content_model', $fields ), 'missing rev_content_model in list of fields' ); - $this->assertFalse( in_array( 'rev_content_format', $fields ), 'missing rev_content_format in list of fields' ); - } - - /** - * @covers Revision::getContentModel - */ - public function testGetContentModel() { - try { - $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT ) ); - - $this->fail( "Creating JavaScript content on a wikitext page should fail with " - . "\$wgContentHandlerUseDB disabled" ); - } catch ( MWException $ex ) { - $this->assertTrue( true ); // ok - } - } - - - /** - * @covers Revision::getContentFormat - */ - public function testGetContentFormat() { - try { - // @todo change this to test failure on using a non-standard (but supported) format - // for a content model supported in the given location. As of 1.21, there are - // no alternative formats for any of the standard content models that could be - // used for this though. - - $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT, - 'content_format' => 'text/javascript' ) ); - - $this->fail( "Creating JavaScript content on a wikitext page should fail with " - . "\$wgContentHandlerUseDB disabled" ); - } catch ( MWException $ex ) { - $this->assertTrue( true ); // ok - } - } -} -- cgit v1.2.3-54-g00ecf