Import: Handle uploads with sha1 starting with 0 properly
[mediawiki.git] / tests / phpunit / mocks / content / DummyNonTextContentHandler.php
blob6995ae78ca90236b3f6dad2eee5869931e6fd04a
1 <?php
3 class DummyNonTextContentHandler extends DummyContentHandlerForTesting {
5 public function __construct( $dataModel ) {
6 parent::__construct( $dataModel, array( "testing-nontext" ) );
9 /**
10 * @see ContentHandler::serializeContent
12 * @param Content $content
13 * @param string $format
15 * @return string
17 public function serializeContent( Content $content, $format = null ) {
18 return $content->serialize();
21 /**
22 * @see ContentHandler::unserializeContent
24 * @param string $blob
25 * @param string $format Unused.
27 * @return Content
29 public function unserializeContent( $blob, $format = null ) {
30 $d = unserialize( $blob );
32 return new DummyNonTextContent( $d );
35 /**
36 * Creates an empty Content object of the type supported by this ContentHandler.
38 public function makeEmptyContent() {
39 return new DummyNonTextContent( '' );
42 public function supportsDirectApiEditing() {
43 return true;