rcfeed: Ensure formatter (and other params) is passed to RCFeedEngine
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 4 Feb 2017 03:31:44 +0000 (03:31 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 4 Feb 2017 03:31:44 +0000 (03:31 +0000)
commit2e37dc5b3cfcf0265e67903470d95e6f1f4f8d27
treebd8d443c1a1d73ac8edcdf983acfad645090eb96
parent7c8af2a87b9e3dbd05939862bffad382f74e003b
rcfeed: Ensure formatter (and other params) is passed to RCFeedEngine

Follows-up 39a6e3dc4d. Class-based feeds are always given their parameters
by RCFeed::factory. However because the old getEngine() method insists
on creating its own object, the constructor parameters were not given.

Add it as optional parameter and pass it through there.

This is backwards-compatible still because before the 39a6e3dc4d refactor,
an RCFeedEngine also was not given information about any formatter and it
was the callers responsibility to format the line before calling send().
CentralAuth still uses it this way and that works fine. The core-caller
that expected the construction parameters since 39a6e3dc4d is hereby fixed.

The test couldn't catch this because it constructed the class instance there,
since PHPUnit does not support a mock class that is instantiated by foreign
code, and the parameter is passed there.

Bug: T156996
Bug: T157106
Change-Id: I83433cf57b6e040cdb69f3ad8807a999c4f931a5
includes/DefaultSettings.php
includes/changes/RecentChange.php
includes/rcfeed/RCFeed.php