Support plain text content.
authordaniel <daniel.kinzler@wikimedia.de>
Wed, 10 Oct 2012 10:42:42 +0000 (12:42 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 14 Oct 2012 23:27:00 +0000 (23:27 +0000)
Made TextContent and TextContentHandler usable directly.
CONTENT_MODEL_TEXT is unused in core, but may be used by extensions.

Change-Id: I8963c968800b98e286cd917a1038a9905b3a0fef

includes/AutoLoader.php
includes/DefaultSettings.php
includes/content/ContentHandler.php
includes/content/TextContent.php
tests/phpunit/includes/CssContentTest.php
tests/phpunit/includes/JavascriptContentTest.php
tests/phpunit/includes/TextContentTest.php [new file with mode: 0644]
tests/phpunit/includes/WikitextContentTest.php

index 1bb740a..3ae5a68 100644 (file)
@@ -1093,8 +1093,8 @@ $wgAutoloadLocalClasses = array(
        'DummyContentForTesting' => 'tests/phpunit/includes/ContentHandlerTest.php',
        'JavascriptContentTest' => 'tests/phpunit/includes/JavascriptContentTest.php',
        'RevisionStorageTest' => 'tests/phpunit/includes/RevisionStorageTest.php',
+       'TextContentTest' => 'tests/phpunit/includes/TextContentTest.php',
        'WikiPageTest' => 'tests/phpunit/includes/WikiPageTest.php',
-       'WikitextContentTest' => 'tests/phpunit/includes/WikitextContentTest.php',
 
        # tests/phpunit/includes
        'GenericArrayObjectTest' => 'tests/phpunit/includes/libs/GenericArrayObjectTest.php',
index 10b7324..0f02efc 100644 (file)
@@ -748,6 +748,7 @@ $wgContentHandlers = array(
        CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler', // the usual case
        CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler', // dumb version, no syntax highlighting
        CONTENT_MODEL_CSS => 'CssContentHandler', // dumb version, no syntax highlighting
+       CONTENT_MODEL_TEXT => 'TextContentHandler', // plain text, for use by extensions etc
 );
 
 /**
index 1d1dad0..4bb4e40 100644 (file)
@@ -302,7 +302,7 @@ abstract class ContentHandler {
                        wfRunHooks( 'ContentHandlerForModelID', array( $modelId, &$handler ) );
 
                        if ( $handler === null ) {
-                               throw new MWException( "No handler for model #$modelId registered in \$wgContentHandlers" );
+                               throw new MWException( "No handler for model '$modelId'' registered in \$wgContentHandlers" );
                        }
 
                        if ( !( $handler instanceof ContentHandler ) ) {
@@ -1084,9 +1084,9 @@ abstract class ContentHandler {
 /**
  * @since 1.21
  */
-abstract class TextContentHandler extends ContentHandler {
+class TextContentHandler extends ContentHandler {
 
-       public function __construct( $modelId, $formats ) {
+       public function __construct( $modelId = CONTENT_MODEL_TEXT, $formats = array( CONTENT_FORMAT_TEXT ) ) {
                parent::__construct( $modelId, $formats );
        }
 
@@ -1142,6 +1142,32 @@ abstract class TextContentHandler extends ContentHandler {
                return $mergedContent;
        }
 
+       /**
+        * Unserializes a Content object of the type supported by this ContentHandler.
+        *
+        * @since 1.21
+        *
+        * @param $text   string serialized form of the content
+        * @param $format null|String the format used for serialization
+        *
+        * @return Content the TextContent object wrapping $text
+        */
+       public function unserializeContent( $text, $format = null ) {
+               $this->checkFormat( $format );
+
+               return new TextContent( $text );
+       }
+
+       /**
+        * Creates an empty TextContent object.
+        *
+        * @since 1.21
+        *
+        * @return Content
+        */
+       public function makeEmptyContent() {
+               return new TextContent( '' );
+       }
 }
 
 /**
index e98584f..9baa7ab 100644 (file)
@@ -7,9 +7,9 @@
  *
  * @since 1.21
  */
-abstract class TextContent extends AbstractContent {
+class TextContent extends AbstractContent {
 
-       public function __construct( $text, $model_id = null ) {
+       public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
                parent::__construct( $model_id );
 
                if ( !is_string( $text ) ) {
@@ -181,4 +181,4 @@ abstract class TextContent extends AbstractContent {
                # TODO: make Highlighter interface, use highlighter here, if available
                return htmlspecialchars( $this->getNativeData() );
        }
-}
\ No newline at end of file
+}
index ebbece2..4f79dfc 100644 (file)
@@ -16,7 +16,7 @@ class CssContentTest extends JavascriptContentTest {
        public function dataGetParserOutput() {
                return array(
                        array("MediaWiki:Test.css", null, "hello <world>\n",
-                               "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>\n"),
+                               "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>"),
                        // @todo: more...?
                );
        }
index a3b75d1..b45caa2 100644 (file)
@@ -6,7 +6,7 @@
  * @group Database
  *        ^--- needed, because we do need the database to test link updates
  */
-class JavascriptContentTest extends WikitextContentTest {
+class JavascriptContentTest extends TextContentTest {
 
        public function newContent( $text ) {
                return new JavascriptContent( $text );
@@ -16,7 +16,7 @@ class JavascriptContentTest extends WikitextContentTest {
        public function dataGetParserOutput() {
                return array(
                        array("MediaWiki:Test.js", null, "hello <world>\n",
-                                       "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>\n"),
+                                       "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>"),
                        // @todo: more...?
                );
        }
@@ -81,18 +81,16 @@ class JavascriptContentTest extends WikitextContentTest {
        }
 
        // XXX: currently, preSaveTransform is applied to scripts. this may change or become optional.
-       /*
        public function dataPreSaveTransform() {
                return array(
                        array( 'hello this is ~~~',
-                              "hello this is ~~~",
+                               "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
                        ),
                        array( 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
-                              'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
+                               'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
                        ),
                );
        }
-       */
 
        public function dataPreloadTransform() {
                return array(
diff --git a/tests/phpunit/includes/TextContentTest.php b/tests/phpunit/includes/TextContentTest.php
new file mode 100644 (file)
index 0000000..ee17a75
--- /dev/null
@@ -0,0 +1,348 @@
+<?php
+
+/**
+ * @group ContentHandler
+ *
+ * @group Database
+ *        ^--- needed, because we do need the database to test link updates
+ */
+class TextContentTest extends MediaWikiTestCase {
+
+       public function setup() {
+               global $wgUser;
+
+               // anon user
+               $wgUser = new User();
+               $wgUser->setName( '127.0.0.1' );
+
+               $this->context = new RequestContext( new FauxRequest() );
+               $this->context->setTitle( Title::newFromText( "Test" ) );
+               $this->context->setUser( $wgUser );
+       }
+
+       public function newContent( $text ) {
+               return new TextContent( $text );
+       }
+
+
+       public function dataGetParserOutput() {
+               return array(
+                       array("TextContentTest_testGetParserOutput", CONTENT_MODEL_TEXT, "hello ''world'' & stuff\n", "hello ''world'' &amp; stuff"),
+                       // @todo: more...?
+               );
+       }
+
+       /**
+        * @dataProvider dataGetParserOutput
+        */
+       public function testGetParserOutput( $title, $model, $text, $expectedHtml ) {
+               $title = Title::newFromText( $title );
+               $content = ContentHandler::makeContent( $text, $title, $model );
+
+               $po = $content->getParserOutput( $title );
+
+               $html = $po->getText();
+               $html = preg_replace( '#<!--.*?-->#sm', '', $html ); // strip comments
+
+               $this->assertEquals( $expectedHtml, trim( $html ) );
+               // @todo: assert more properties
+       }
+
+       public function dataPreSaveTransform() {
+               return array(
+                       array( 'hello this is ~~~',
+                              "hello this is ~~~",
+                       ),
+               );
+       }
+
+       /**
+        * @dataProvider dataPreSaveTransform
+        */
+       public function testPreSaveTransform( $text, $expected ) {
+               global $wgContLang;
+
+               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang );
+
+               $content = $this->newContent( $text );
+               $content = $content->preSaveTransform( $this->context->getTitle(), $this->context->getUser(), $options );
+
+               $this->assertEquals( $expected, $content->getNativeData() );
+       }
+
+       public function dataPreloadTransform() {
+               return array(
+                       array( 'hello this is ~~~',
+                              "hello this is ~~~",
+                       ),
+               );
+       }
+
+       /**
+        * @dataProvider dataPreloadTransform
+        */
+       public function testPreloadTransform( $text, $expected ) {
+               global $wgContLang;
+               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang );
+
+               $content = $this->newContent( $text );
+               $content = $content->preloadTransform( $this->context->getTitle(), $options );
+
+               $this->assertEquals( $expected, $content->getNativeData() );
+       }
+
+       public function dataGetRedirectTarget() {
+               return array(
+                       array( '#REDIRECT [[Test]]',
+                               null,
+                       ),
+               );
+       }
+
+       /**
+        * @dataProvider dataGetRedirectTarget
+        */
+       public function testGetRedirectTarget( $text, $expected ) {
+               $content = $this->newContent( $text );
+               $t = $content->getRedirectTarget( );
+
+               if ( is_null( $expected ) ) {
+                       $this->assertNull( $t, "text should not have generated a redirect target: $text" );
+               } else {
+                       $this->assertEquals( $expected, $t->getPrefixedText() );
+               }
+       }
+
+       /**
+        * @dataProvider dataGetRedirectTarget
+        */
+       public function isRedirect( $text, $expected ) {
+               $content = $this->newContent( $text );
+
+               $this->assertEquals( !is_null($expected), $content->isRedirect() );
+       }
+
+
+       /**
+        * @todo: test needs database! Should be done by a test class in the Database group.
+        */
+       /*
+       public function getRedirectChain() {
+               $text = $this->getNativeData();
+               return Title::newFromRedirectArray( $text );
+       }
+       */
+
+       /**
+        * @todo: test needs database! Should be done by a test class in the Database group.
+        */
+       /*
+       public function getUltimateRedirectTarget() {
+               $text = $this->getNativeData();
+               return Title::newFromRedirectRecurse( $text );
+       }
+       */
+
+
+       public function dataIsCountable() {
+               return array(
+                       array( '',
+                              null,
+                              'any',
+                              true
+                       ),
+                       array( 'Foo',
+                              null,
+                              'any',
+                              true
+                       ),
+                       array( 'Foo',
+                              null,
+                              'comma',
+                              false
+                       ),
+                       array( 'Foo, bar',
+                              null,
+                              'comma',
+                              false
+                       ),
+               );
+       }
+
+
+       /**
+        * @dataProvider dataIsCountable
+        * @group Database
+        */
+       public function testIsCountable( $text, $hasLinks, $mode, $expected ) {
+               global $wgArticleCountMethod;
+
+               $old = $wgArticleCountMethod;
+               $wgArticleCountMethod = $mode;
+
+               $content = $this->newContent( $text );
+
+               $v = $content->isCountable( $hasLinks, $this->context->getTitle() );
+               $wgArticleCountMethod = $old;
+
+               $this->assertEquals( $expected, $v, "isCountable() returned unexpected value " . var_export( $v, true )
+                                                   . " instead of " . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" );
+       }
+
+       public function dataGetTextForSummary() {
+               return array(
+                       array( "hello\nworld.",
+                              16,
+                              'hello world.',
+                       ),
+                       array( 'hello world.',
+                              8,
+                              'hello...',
+                       ),
+                       array( '[[hello world]].',
+                              8,
+                              '[[hel...',
+                       ),
+               );
+       }
+
+       /**
+        * @dataProvider dataGetTextForSummary
+        */
+       public function testGetTextForSummary( $text, $maxlength, $expected ) {
+               $content = $this->newContent( $text );
+
+               $this->assertEquals( $expected, $content->getTextForSummary( $maxlength ) );
+       }
+
+
+       public function testGetTextForSearchIndex( ) {
+               $content = $this->newContent( "hello world." );
+
+               $this->assertEquals( "hello world.", $content->getTextForSearchIndex() );
+       }
+
+       public function testCopy() {
+               $content = $this->newContent( "hello world." );
+               $copy = $content->copy();
+
+               $this->assertTrue( $content->equals( $copy ), "copy must be equal to original" );
+               $this->assertEquals( "hello world.", $copy->getNativeData() );
+       }
+
+       public function testGetSize( ) {
+               $content = $this->newContent( "hello world." );
+
+               $this->assertEquals( 12, $content->getSize() );
+       }
+
+       public function testGetNativeData( ) {
+               $content = $this->newContent( "hello world." );
+
+               $this->assertEquals( "hello world.", $content->getNativeData() );
+       }
+
+       public function testGetWikitextForTransclusion( ) {
+               $content = $this->newContent( "hello world." );
+
+               $this->assertEquals( "hello world.", $content->getWikitextForTransclusion() );
+       }
+
+       # =================================================================================================================
+
+       public function testGetModel() {
+               $content = $this->newContent( "hello world." );
+
+               $this->assertEquals( CONTENT_MODEL_TEXT, $content->getModel() );
+       }
+
+       public function testGetContentHandler() {
+               $content = $this->newContent( "hello world." );
+
+               $this->assertEquals( CONTENT_MODEL_TEXT, $content->getContentHandler()->getModelID() );
+       }
+
+       public function dataIsEmpty( ) {
+               return array(
+                       array( '', true ),
+                       array( '  ', false ),
+                       array( '0', false ),
+                       array( 'hallo welt.', false ),
+               );
+       }
+
+       /**
+        * @dataProvider dataIsEmpty
+        */
+       public function testIsEmpty( $text, $empty ) {
+               $content = $this->newContent( $text );
+
+               $this->assertEquals( $empty, $content->isEmpty() );
+       }
+
+       public function dataEquals( ) {
+               return array(
+                       array( new TextContent( "hallo" ), null, false ),
+                       array( new TextContent( "hallo" ), new TextContent( "hallo" ), true ),
+                       array( new TextContent( "hallo" ), new JavascriptContent( "hallo" ), false ),
+                       array( new TextContent( "hallo" ), new WikitextContent( "hallo" ), false ),
+                       array( new TextContent( "hallo" ), new TextContent( "HALLO" ), false ),
+               );
+       }
+
+       /**
+        * @dataProvider dataEquals
+        */
+       public function testEquals( Content $a, Content $b = null, $equal = false ) {
+               $this->assertEquals( $equal, $a->equals( $b ) );
+       }
+
+       public function dataGetDeletionUpdates() {
+               return array(
+                       array("TextContentTest_testGetSecondaryDataUpdates_1",
+                               CONTENT_MODEL_TEXT, "hello ''world''\n",
+                               array( )
+                       ),
+                       array("TextContentTest_testGetSecondaryDataUpdates_2",
+                               CONTENT_MODEL_TEXT, "hello [[world test 21344]]\n",
+                               array( )
+                       ),
+                       // @todo: more...?
+               );
+       }
+
+       /**
+        * @dataProvider dataGetDeletionUpdates
+        */
+       public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) {
+               $title = Title::newFromText( $title );
+               $title->resetArticleID( 2342 ); //dummy id. fine as long as we don't try to execute the updates!
+
+               $content = ContentHandler::makeContent( $text, $title, $model );
+
+               $updates = $content->getDeletionUpdates( WikiPage::factory( $title ) );
+
+               // make updates accessible by class name
+               foreach ( $updates as $update ) {
+                       $class = get_class( $update );
+                       $updates[ $class ] = $update;
+               }
+
+               if ( !$expectedStuff ) {
+                       $this->assertTrue( true ); // make phpunit happy
+                       return;
+               }
+
+               foreach ( $expectedStuff as $class => $fieldValues ) {
+                       $this->assertArrayHasKey( $class, $updates, "missing an update of type $class" );
+
+                       $update = $updates[ $class ];
+
+                       foreach ( $fieldValues as $field => $value ) {
+                               $v = $update->$field; #if the field doesn't exist, just crash and burn
+                               $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" );
+                       }
+               }
+       }
+
+}
index dac8041..e6118ea 100644 (file)
@@ -6,25 +6,12 @@
  * @group Database
  *        ^--- needed, because we do need the database to test link updates
  */
-class WikitextContentTest extends MediaWikiTestCase {
-
-       public function setup() {
-               global $wgUser;
-
-               // anon user
-               $wgUser = new User();
-               $wgUser->setName( '127.0.0.1' );
-
-               $this->context = new RequestContext( new FauxRequest() );
-               $this->context->setTitle( Title::newFromText( "Test" ) );
-               $this->context->setUser( $wgUser );
-       }
+class WikitextContentTest extends TextContentTest {
 
        public function newContent( $text ) {
                return new WikitextContent( $text );
        }
 
-
        public function dataGetParserOutput() {
                return array(
                        array("WikitextContentTest_testGetParserOutput", CONTENT_MODEL_WIKITEXT, "hello ''world''\n", "<p>hello <i>world</i>\n</p>"),
@@ -32,19 +19,6 @@ class WikitextContentTest extends MediaWikiTestCase {
                );
        }
 
-       /**
-        * @dataProvider dataGetParserOutput
-        */
-       public function testGetParserOutput( $title, $model, $text, $expectedHtml ) {
-               $title = Title::newFromText( $title );
-               $content = ContentHandler::makeContent( $text, $title, $model );
-
-               $po = $content->getParserOutput( $title );
-
-               $this->assertEquals( $expectedHtml, $po->getText() );
-               // @todo: assert more properties
-       }
-
        public function dataGetSecondaryDataUpdates() {
                return array(
                        array("WikitextContentTest_testGetSecondaryDataUpdates_1",
@@ -198,20 +172,6 @@ just a test"
                );
        }
 
-       /**
-        * @dataProvider dataPreSaveTransform
-        */
-       public function testPreSaveTransform( $text, $expected ) {
-               global $wgContLang;
-
-               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang );
-
-               $content = $this->newContent( $text );
-               $content = $content->preSaveTransform( $this->context->getTitle(), $this->context->getUser(), $options );
-
-               $this->assertEquals( $expected, $content->getNativeData() );
-       }
-
        public function dataPreloadTransform() {
                return array(
                        array( 'hello this is ~~~',
@@ -223,19 +183,6 @@ just a test"
                );
        }
 
-       /**
-        * @dataProvider dataPreloadTransform
-        */
-       public function testPreloadTransform( $text, $expected ) {
-               global $wgContLang;
-               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang );
-
-               $content = $this->newContent( $text );
-               $content = $content->preloadTransform( $this->context->getTitle(), $options );
-
-               $this->assertEquals( $expected, $content->getNativeData() );
-       }
-
        public function dataGetRedirectTarget() {
                return array(
                        array( '#REDIRECT [[Test]]',
@@ -250,30 +197,23 @@ just a test"
                );
        }
 
-       /**
-        * @dataProvider dataGetRedirectTarget
-        */
-       public function testGetRedirectTarget( $text, $expected ) {
-               $content = $this->newContent( $text );
-               $t = $content->getRedirectTarget( );
-
-               if ( is_null( $expected ) ) {
-                       $this->assertNull( $t, "text should not have generated a redirect target: $text" );
-               } else {
-                       $this->assertEquals( $expected, $t->getPrefixedText() );
-               }
-       }
-
-       /**
-        * @dataProvider dataGetRedirectTarget
-        */
-       public function isRedirect( $text, $expected ) {
-               $content = $this->newContent( $text );
-
-               $this->assertEquals( !is_null($expected), $content->isRedirect() );
+       public function dataGetTextForSummary() {
+               return array(
+                       array( "hello\nworld.",
+                               16,
+                               'hello world.',
+                       ),
+                       array( 'hello world.',
+                               8,
+                               'hello...',
+                       ),
+                       array( '[[hello world]].',
+                               8,
+                               'hel...',
+                       ),
+               );
        }
 
-
        /**
         * @todo: test needs database! Should be done by a test class in the Database group.
         */
@@ -355,85 +295,6 @@ just a test"
                );
        }
 
-
-       /**
-        * @dataProvider dataIsCountable
-        * @group Database
-        */
-       public function testIsCountable( $text, $hasLinks, $mode, $expected ) {
-               global $wgArticleCountMethod;
-
-               $old = $wgArticleCountMethod;
-               $wgArticleCountMethod = $mode;
-
-               $content = $this->newContent( $text );
-
-               $v = $content->isCountable( $hasLinks, $this->context->getTitle() );
-               $wgArticleCountMethod = $old;
-
-               $this->assertEquals( $expected, $v, "isCountable() returned unexpected value " . var_export( $v, true )
-                                                   . " instead of " . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" );
-       }
-
-       public function dataGetTextForSummary() {
-               return array(
-                       array( "hello\nworld.",
-                              16,
-                              'hello world.',
-                       ),
-                       array( 'hello world.',
-                              8,
-                              'hello...',
-                       ),
-                       array( '[[hello world]].',
-                              8,
-                              'hel...',
-                       ),
-               );
-       }
-
-       /**
-        * @dataProvider dataGetTextForSummary
-        */
-       public function testGetTextForSummary( $text, $maxlength, $expected ) {
-               $content = $this->newContent( $text );
-
-               $this->assertEquals( $expected, $content->getTextForSummary( $maxlength ) );
-       }
-
-
-       public function testGetTextForSearchIndex( ) {
-               $content = $this->newContent( "hello world." );
-
-               $this->assertEquals( "hello world.", $content->getTextForSearchIndex() );
-       }
-
-       public function testCopy() {
-               $content = $this->newContent( "hello world." );
-               $copy = $content->copy();
-
-               $this->assertTrue( $content->equals( $copy ), "copy must be equal to original" );
-               $this->assertEquals( "hello world.", $copy->getNativeData() );
-       }
-
-       public function testGetSize( ) {
-               $content = $this->newContent( "hello world." );
-
-               $this->assertEquals( 12, $content->getSize() );
-       }
-
-       public function testGetNativeData( ) {
-               $content = $this->newContent( "hello world." );
-
-               $this->assertEquals( "hello world.", $content->getNativeData() );
-       }
-
-       public function testGetWikitextForTransclusion( ) {
-               $content = $this->newContent( "hello world." );
-
-               $this->assertEquals( "hello world.", $content->getWikitextForTransclusion() );
-       }
-
        public function testMatchMagicWord( ) {
                $mw = MagicWord::get( "staticredirect" );
 
@@ -477,40 +338,16 @@ just a test"
                $this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getContentHandler()->getModelID() );
        }
 
-       public function dataIsEmpty( ) {
-               return array(
-                       array( '', true ),
-                       array( '  ', false ),
-                       array( '0', false ),
-                       array( 'hallo welt.', false ),
-               );
-       }
-
-       /**
-        * @dataProvider dataIsEmpty
-        */
-       public function testIsEmpty( $text, $empty ) {
-               $content = $this->newContent( $text );
-
-               $this->assertEquals( $empty, $content->isEmpty() );
-       }
-
        public function dataEquals( ) {
                return array(
                        array( new WikitextContent( "hallo" ), null, false ),
                        array( new WikitextContent( "hallo" ), new WikitextContent( "hallo" ), true ),
                        array( new WikitextContent( "hallo" ), new JavascriptContent( "hallo" ), false ),
+                       array( new WikitextContent( "hallo" ), new TextContent( "hallo" ), false ),
                        array( new WikitextContent( "hallo" ), new WikitextContent( "HALLO" ), false ),
                );
        }
 
-       /**
-        * @dataProvider dataEquals
-        */
-       public function testEquals( Content $a, Content $b = null, $equal = false ) {
-               $this->assertEquals( $equal, $a->equals( $b ) );
-       }
-
        public function dataGetDeletionUpdates() {
                return array(
                        array("WikitextContentTest_testGetSecondaryDataUpdates_1",
@@ -525,33 +362,4 @@ just a test"
                );
        }
 
-       /**
-        * @dataProvider dataGetDeletionUpdates
-        */
-       public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) {
-               $title = Title::newFromText( $title );
-               $title->resetArticleID( 2342 ); //dummy id. fine as long as we don't try to execute the updates!
-
-               $content = ContentHandler::makeContent( $text, $title, $model );
-
-               $updates = $content->getDeletionUpdates( WikiPage::factory( $title ) );
-
-               // make updates accessible by class name
-               foreach ( $updates as $update ) {
-                       $class = get_class( $update );
-                       $updates[ $class ] = $update;
-               }
-
-               foreach ( $expectedStuff as $class => $fieldValues ) {
-                       $this->assertArrayHasKey( $class, $updates, "missing an update of type $class" );
-
-                       $update = $updates[ $class ];
-
-                       foreach ( $fieldValues as $field => $value ) {
-                               $v = $update->$field; #if the field doesn't exist, just crash and burn
-                               $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" );
-                       }
-               }
-       }
-
 }