Debian Codegraph @

extensions/DiscussionTools/tests/phpunit/MockEventDispatcher.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Extension\DiscussionTools\Tests;
4
5 use MediaWiki\Extension\DiscussionTools\ContentThreadItemSet;
6 use MediaWiki\Extension\DiscussionTools\Notifications\EventDispatcher;
7 use MediaWiki\Page\PageIdentity;
8 use MediaWiki\Revision\RevisionRecord;
9 use MediaWiki\Title\Title;
10 use MediaWiki\User\UserIdentity;
11
12 class MockEventDispatcher extends EventDispatcher {
13
14 /**
15 * Public for testing
16 *
17 * Note that we can't use TestingAccessWrapper instead of this, because it doesn't support passing
18 * arguments by reference (causes exceptions like "PHPUnit\Framework\Error\Warning: Parameter 1 to
19 * ... expected to be a reference, value given").
20 */
21 public static function generateEventsFromItemSets(
22 array &$events,
23 ContentThreadItemSet $oldItemSet,
24 ContentThreadItemSet $newItemSet,
25 RevisionRecord $newRevRecord,
26 PageIdentity $title,
27 UserIdentity $user
28 ): void {
29 parent::generateEventsFromItemSets(
30 $events,
31 $oldItemSet,
32 $newItemSet,
33 $newRevRecord,
34 $title,
35 $user
36 );
37 }
38
39 /**
40 * No-op for testing
41 */
42 public static function addCommentChangeTag( RevisionRecord $newRevRecord ): void {
43 }
44
45 /**
46 * No-op for testing
47 */
48 protected static function addAutoSubscription( UserIdentity $user, Title $title, string $itemName ): void {
49 }
50
51 }