Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / tests / phpunit / mocks / content / DummyNonTextContentHandler.php
1 <?php
2
3 class DummyNonTextContentHandler extends DummyContentHandlerForTesting {
4
5 public function __construct( $dataModel ) {
6 parent::__construct( $dataModel, [ "testing-nontext" ] );
7 }
8
9 /**
10 * @see ContentHandler::serializeContent
11 *
12 * @param Content $content
13 * @param string $format
14 *
15 * @return string
16 */
17 public function serializeContent( Content $content, $format = null ) {
18 return $content->serialize();
19 }
20
21 /**
22 * @see ContentHandler::unserializeContent
23 *
24 * @param string $blob
25 * @param string $format Unused.
26 *
27 * @return Content
28 */
29 public function unserializeContent( $blob, $format = null ) {
30 $d = unserialize( $blob );
31
32 return new DummyNonTextContent( $d );
33 }
34
35 /**
36 * Creates an empty Content object of the type supported by this ContentHandler.
37 * @return DummyNonTextContent
38 */
39 public function makeEmptyContent() {
40 return new DummyNonTextContent( '' );
41 }
42
43 public function supportsDirectApiEditing() {
44 return true;
45 }
46
47 }