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