Import: Handle uploads with sha1 starting with 0 properly
[mediawiki.git] / tests / phpunit / mocks / content / DummyContentHandlerForTesting.php
blobfd253f2123318045bdd8fd1dc91ad80d154b57eb
1 <?php
3 class DummyContentHandlerForTesting extends ContentHandler {
5 public function __construct( $dataModel ) {
6 parent::__construct( $dataModel, array( "testing" ) );
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 DummyContentForTesting( $d );
35 /**
36 * Creates an empty Content object of the type supported by this ContentHandler.
39 public function makeEmptyContent() {
40 return new DummyContentForTesting( '' );