It's an attribute, so it is definitely the manager's
responsibility. Unit test case included.
(EchoDataOutputFormatter really calls for becoming a service.)
Change-Id: If2658dd8c107246158cd93cbb233d8af62fd4424
Previously, ApiEchoNotifications returned only events which were
enabled for the `web` notifier type. With this change, the notifier
type or types to consider can be specified by argument to the new
`notifiertypes` parameter.
This change is required so that the apps can request notification
content from the API for push notifications.
Bug: T287909
Change-Id: I2d1155e113f2defb0f02416a7a659c3ee162d3a6
At the moment we support a maximum of 10 tokens per user for subscribing
to push notifications, stored as a basic list that runs out when the
limit is reached. There may, however, be some edge cases where an app
registers a token and then forgets to unregister it (and repeats this 10
times), after which time it will be unable to register any new token.
This changes the token list to behave more like a circular buffer, by
simply deleting the oldest token before inserting the new one. This way
an app could register a new token even in the rare case of forgetting
the previous ten.
Change-Id: I387de63460882e4e56d1aa6db1f78d73a0495208
* Fix off-by-one counting
* Fix asserting properties on the wrong event (first one instead of
last one), luckily they are identical
Change-Id: Ib1a02476554b29b2a1d0bfdfa89859d71d7691b1
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()
Bug: T277818
Change-Id: I001301fb95635c421a0bbb921fd909c5312dc896
::doUserEditContent() is available since 1.36 as a replacement
for ::doEditContent(), which has been deprecated. Extension
already requires MediaWiki 1.37+, so the method is always
available.
Bug: T255507
Change-Id: Iee5de356dbccd453a3083e0a58859b4cd83a946b
JUnit reporter is required to create the XML file that Jenkins uses to
create Test Result Trend chart for selenium-daily-beta-Echo
job.
Bug: T214686
Change-Id: I2dd3787ebfb20f6fee841d264de98bcd1da4b34e
The old ApiTestCase::getTokenList relied on CSRF
token API deprecated in 1.26. Many years have passed,
it's time to swtich to new mechanisms.
Needed-By: I58aedec6942ac5d3c21574cb0072f00ef365098c
Change-Id: Iafe7a48eb0cdf8c2f1ec7fdee232c3f394fa15a3
Directly constructing SpecialPages is bad, they're not @newable
and core can change constructor signatures without deprecation
and break the tests.
Change-Id: Ifc82d29a00d3fd136c44e0699e6bbfa11b8cf2a6
We're working on code in DiscussionTools that generates Echo events for
adding talk page comments (I7e0996843cdd70141e19d5c7ce66122204efa1b7),
and it was causing this test to fail.
Change-Id: I3099473a3113962911b9c77ede290142857a51b2
Adds AttributeManager to EchoServices so that dependencies of
AttributeManager can be injected.
Bug: T275148
Change-Id: I4fa5084d72914d16b6d218e7dd3521f5a1919b80
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.ObjectTypeHintParam
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected
* MediaWiki.Commenting.PropertyDocumentation.MissingVar
* MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage
Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).
Change-Id: I46e3dacb3da1266ff52d614003ad911feeb7504e
* EchoEvent now supports `extra` params for job delay and deduplication
* When Echo identifies this type of param it creates a
DelayedEchoNotificationJob that will be executed after `delay` seconds
Change-Id: Ib0c6789dfe42e9703a67835909e5932c0054089f
It appears like the initial \h in this non-Unicode regular
expression matches parts of an UTF-8 character, destroying it.
This makes the final preg_match() in this method fail, when
$output is going to be used as a pattern.
Bug: T264922
Change-Id: Iaf240bc2e0808c2f57c1f8bab2589d3207915afe
Since its a unit test, the use of User::newFromId
prevents attempts in core to migrate to
the UserFactory.
Change-Id: If5e76f2ae570ef4ae58cb77b5281c4446a1cadff
EchoAttributeManager::getUserCallable casts to array,
which means that even a non-array value (e.g. a simple callback)
becomes an array and NotificationController::evaluateUserCallable
will handle it just fine. But tests seemed to thing it was wrong.
Change-Id: Ia1e1e4015ebbc4d79bba5274e802911f222692c0