6 class RCFeedIntegrationTest
extends MediaWikiTestCase
{
7 protected function setUp() {
10 'wgCanonicalServer' => 'https://example.org',
11 'wgServerName' => 'example.org',
12 'wgScriptPath' => '/w',
13 'wgDBname' => 'example',
21 * @covers RecentChange::notifyRCFeeds
22 * @covers RecentChange::getEngine
23 * @covers RCFeed::factory
24 * @covers FormattedRCFeed::__construct
25 * @covers FormattedRCFeed::notify
26 * @covers JSONRCFeedFormatter::formatArray
27 * @covers MachineReadableRCFeedFormatter::getLine
29 public function testNotify() {
30 $feed = $this->getMockBuilder( 'RCFeedEngine' )
31 ->setConstructorArgs( [ [ 'formatter' => 'JSONRCFeedFormatter' ] ] )
32 ->setMethods( [ 'send' ] )
35 $feed->method( 'send' )
38 $feed->expects( $this->once() )
40 ->with( $this->anything(), $this->callback( function ( $line ) {
41 $this->assertJsonStringEqualsJsonString(
48 'timestamp' => 1301644800,
53 'log_action' => 'move',
59 'log_action_comment' => '',
60 'server_url' => 'https://example.org',
61 'server_name' => 'example.org',
62 'server_script_path' => '/w',
70 $this->setMwGlobals( [
73 'uri' => 'test://localhost:1234',
74 'formatter' => 'JSONRCFeedFormatter',
81 $logpage = SpecialPage
::getTitleFor( 'Log', 'move' );
82 $user = $this->getTestSysop()->getUser();
83 $rc = RecentChange
::newLogEntry(
91 Title
::makeTitle( 0, 'Example' ), // $target
93 LogEntryBase
::makeParamBlob( [
94 '4::color' => 'green',