Merge "Update docs/hooks.txt for ShowSearchHitTitle"
[mediawiki.git] / tests / phpunit / mocks / content / DummyNonTextContentHandler.php
blob098181debbdef7f0d717d3187d8f73bbb5c675b0
1 <?php
3 class DummyNonTextContentHandler extends DummyContentHandlerForTesting {
5 public function __construct( $dataModel ) {
6 parent::__construct( $dataModel, [ "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;