X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/tests/phpunit/mocks/content/DummyNonTextContentHandler.php diff --git a/tests/phpunit/mocks/content/DummyNonTextContentHandler.php b/tests/phpunit/mocks/content/DummyNonTextContentHandler.php new file mode 100644 index 00000000..9d91d4a1 --- /dev/null +++ b/tests/phpunit/mocks/content/DummyNonTextContentHandler.php @@ -0,0 +1,47 @@ +serialize(); + } + + /** + * @see ContentHandler::unserializeContent + * + * @param string $blob + * @param string $format Unused. + * + * @return Content + */ + public function unserializeContent( $blob, $format = null ) { + $d = unserialize( $blob ); + + return new DummyNonTextContent( $d ); + } + + /** + * Creates an empty Content object of the type supported by this ContentHandler. + * @return DummyNonTextContent + */ + public function makeEmptyContent() { + return new DummyNonTextContent( '' ); + } + + public function supportsDirectApiEditing() { + return true; + } + +}