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 RCFeedEngine
21 * @covers JSONRCFeedFormatter::formatArray
22 * @covers MachineReadableRCFeedFormatter::getLine
24 public function testNotify() {
25 $feed = $this->getMockBuilder( 'RCFeedEngine' )
26 ->setConstructorArgs( [ [ 'formatter' => 'JSONRCFeedFormatter' ] ] )
27 ->setMethods( [ 'send' ] )
30 $feed->method( 'send' )
33 $feed->expects( $this->once() )
35 ->with( $this->anything(), $this->callback( function ( $line ) {
36 $this->assertJsonStringEqualsJsonString(
43 'timestamp' => 1301644800,
48 'log_action' => 'move',
54 'log_action_comment' => '',
55 'server_url' => 'https://example.org',
56 'server_name' => 'example.org',
57 'server_script_path' => '/w',
65 $this->setMwGlobals( [
68 'uri' => 'test://localhost:1234',
69 'formatter' => 'JSONRCFeedFormatter',
76 $logpage = SpecialPage
::getTitleFor( 'Log', 'move' );
77 $user = $this->getTestSysop()->getUser();
78 $rc = RecentChange
::newLogEntry(
86 Title
::makeTitle( 0, 'Example' ), // $target
88 LogEntryBase
::makeParamBlob( [
89 '4::color' => 'green',