2021-07-15 13:56:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Tests;
|
|
|
|
|
2022-03-18 03:28:06 +00:00
|
|
|
use MediaWiki\Extension\DiscussionTools\ContentThreadItemSet;
|
2021-07-15 13:56:13 +00:00
|
|
|
use MediaWiki\Extension\DiscussionTools\Notifications\EventDispatcher;
|
|
|
|
use MediaWiki\Page\PageIdentity;
|
|
|
|
use MediaWiki\Revision\RevisionRecord;
|
|
|
|
use MediaWiki\User\UserIdentity;
|
2021-08-17 20:23:27 +00:00
|
|
|
use Title;
|
2021-07-15 13:56:13 +00:00
|
|
|
|
|
|
|
class MockEventDispatcher extends EventDispatcher {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Public for testing
|
|
|
|
*
|
|
|
|
* Note that we can't use TestingAccessWrapper instead of this, because it doesn't support passing
|
|
|
|
* arguments by reference (causes exceptions like "PHPUnit\Framework\Error\Warning: Parameter 1 to
|
|
|
|
* ... expected to be a reference, value given").
|
|
|
|
*
|
|
|
|
* @param array &$events
|
2022-03-18 03:28:06 +00:00
|
|
|
* @param ContentThreadItemSet $oldItemSet
|
|
|
|
* @param ContentThreadItemSet $newItemSet
|
2021-07-15 13:56:13 +00:00
|
|
|
* @param RevisionRecord $newRevRecord
|
|
|
|
* @param PageIdentity $title
|
|
|
|
* @param UserIdentity $user
|
|
|
|
*/
|
2022-02-19 06:31:34 +00:00
|
|
|
public static function generateEventsFromItemSets(
|
2021-07-15 13:56:13 +00:00
|
|
|
array &$events,
|
2022-03-18 03:28:06 +00:00
|
|
|
ContentThreadItemSet $oldItemSet,
|
|
|
|
ContentThreadItemSet $newItemSet,
|
2021-07-15 13:56:13 +00:00
|
|
|
RevisionRecord $newRevRecord,
|
|
|
|
PageIdentity $title,
|
|
|
|
UserIdentity $user
|
2021-12-01 14:53:20 +00:00
|
|
|
): void {
|
2022-02-19 06:31:34 +00:00
|
|
|
parent::generateEventsFromItemSets(
|
2021-07-15 13:56:13 +00:00
|
|
|
$events,
|
2022-02-19 06:31:34 +00:00
|
|
|
$oldItemSet,
|
|
|
|
$newItemSet,
|
2021-07-15 13:56:13 +00:00
|
|
|
$newRevRecord,
|
|
|
|
$title,
|
|
|
|
$user
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-07-22 18:05:34 +00:00
|
|
|
/**
|
|
|
|
* No-op for testing
|
|
|
|
*
|
|
|
|
* @param RevisionRecord $newRevRecord
|
|
|
|
*/
|
2021-12-01 14:53:20 +00:00
|
|
|
public static function addCommentChangeTag( RevisionRecord $newRevRecord ): void {
|
2021-07-22 18:05:34 +00:00
|
|
|
}
|
|
|
|
|
2021-08-17 20:23:27 +00:00
|
|
|
/**
|
|
|
|
* No-op for testing
|
|
|
|
*
|
|
|
|
* @param UserIdentity $user
|
|
|
|
* @param Title $title
|
|
|
|
* @param string $itemName
|
|
|
|
*/
|
2021-12-01 14:53:20 +00:00
|
|
|
protected static function addAutoSubscription( UserIdentity $user, Title $title, string $itemName ): void {
|
2021-08-17 20:23:27 +00:00
|
|
|
}
|
|
|
|
|
2021-07-15 13:56:13 +00:00
|
|
|
}
|