123 ); } ), array( 'merges results of multiple locators', // expected result array( 123, 456 ), // event user locator config array( function() { return array( 123 => 123 ); }, function() { return array( 456 => 456 ); }, ), ), ); } /** * @dataProvider getUsersToNotifyForEventProvider */ public function testGetUsersToNotifyForEvent( $message, $expect, $locatorConfigForEventType ) { $this->setMwGlobals( array( 'wgEchoNotifications' => array( 'unit-test' => array( 'user-locators' => $locatorConfigForEventType ), ), ) ); $event = $this->getMockBuilder( 'EchoEvent' ) ->disableOriginalConstructor() ->getMock(); $event->expects( $this->any() ) ->method( 'getType' ) ->will( $this->returnValue( 'unit-test' ) ); $users = EchoNotificationController::getUsersToNotifyForEvent( $event ); $this->assertEquals( $expect, array_keys( $users ), $message ); } }