3 class RCFeedIntegrationTest
extends MediaWikiTestCase
{
4 protected function setUp() {
7 'wgCanonicalServer' => 'https://example.org',
8 'wgServerName' => 'example.org',
9 'wgScriptPath' => '/w',
10 'wgDBname' => 'example',
18 * @covers RecentChange::notifyRCFeeds
19 * @covers RecentChange::getEngine
20 * @covers RCFeed::factory
21 * @covers FormattedRCFeed::__construct
22 * @covers FormattedRCFeed::notify
23 * @covers JSONRCFeedFormatter::formatArray
24 * @covers MachineReadableRCFeedFormatter::getLine
26 public function testNotify() {
27 $feed = $this->getMockBuilder( 'RCFeedEngine' )
28 ->setConstructorArgs( [ [ 'formatter' => 'JSONRCFeedFormatter' ] ] )
29 ->setMethods( [ 'send' ] )
32 $feed->method( 'send' )
35 $feed->expects( $this->once() )
37 ->with( $this->anything(), $this->callback( function ( $line ) {
38 $this->assertJsonStringEqualsJsonString(
45 'timestamp' => 1301644800,
50 'log_action' => 'move',
56 'log_action_comment' => '',
57 'server_url' => 'https://example.org',
58 'server_name' => 'example.org',
59 'server_script_path' => '/w',
67 $this->setMwGlobals( [
70 'uri' => 'test://localhost:1234',
71 'formatter' => 'JSONRCFeedFormatter',
78 $logpage = SpecialPage
::getTitleFor( 'Log', 'move' );
79 $user = $this->getTestSysop()->getUser();
80 $rc = RecentChange
::newLogEntry(
88 Title
::makeTitle( 0, 'Example' ), // $target
90 LogEntryBase
::makeParamBlob( [
91 '4::color' => 'green',