Until PHPUnit7, the Stub interface came from phpunit-mock-object, and it
was at PHPUnit\Framework\MockObject\Stub. Then, phpunit-mock-object was
merged into PHPUnit, and:
- The interface above was moved to PHPUnit\Framework\MockObject\Stub\Stub
- The FQSEN above started pointing at a completely different interface
This is a temporary hack to allow upgrading to PHPUnit 8, and MUST be
removed as soon as the upgrade is complete.
The :string typehint is also necessary in PHPUnit8, and it will work
with PHPUnit 6 as well.
Bug: T192167
Change-Id: I07cebd07088bced5c5ddc62936f0098dfa39e151
assertEquals() does not compare the type. It can not only be a float,
it can even be a string. E.g. 9 and '9' are considered equal.
Worst case scenarios are:
* 0 is considered equal to any "falsy" value, including the empty
string.
* 1 is considered equal to true.
assertSame() does not have any of these confusing edge-cases.
Change-Id: Ib6af0fefbbd8856adcf27844bb8ddd8e33ed3f9d
Not all tools require these to be absolute, full qualified class
names. But some do. This does make the code more compatible with all
kinds of tools.
Change-Id: Ie7f9d9469b7a48b2fe908d3428fca9ec0120f855
This code will be enabled when Iba1d7863171268066bf7597182c57a0a2041497f
relinquishes the responsibility for rendering the Echo notification badge
and wiring up of the related JS.
It makes 3 assumptions:
1) Minerva will expose a VERSION property on the skins.minerva.scripts module
to tell Echo it can begin control of the functionality
2) A new hook `SkinMinervaReplaceNotificationsBadge` will run on the server side
allowing Echo extension to render the Notifications badge in Minerva.
3) A new client side hook (echo.mobile) will fire whenever the Echo dialog is opened or
closed.
All code relating to Echo inside MobileFrontend and Minerva is
moved here.
CSS for the modules is kept in Minerva as skinStyles
This code remains dormant until Iba1d7863171268066bf7597182c57a0a2041497f lands.
It pre-registers a "to-be-created" hook SkinMinervaReplaceNotificationsBadge that
substitutes the Minerva badge.
It also watches the export value of skins.minerva.scripts for a VERSION value - when
this appears it will take the signal that it should manage the frontend code.
In the new system the mobile specific code is limited to the mobile version of
Minerva. The desktop version of Echo loads on Minerva desktop - presenting an
opportunity in future to consolidate both implementations to use the same component.
The mobile version of Vector and Timeless for example will load the mobile overlay
(with existing styling issues that we don't need to worry about right now given
we don't officially support skins other than Minerva as mobile)
Testers:
* Check require( 'ext.echo.mobile' )(); inside initMobile
inside ext.echo.init does not fire until
Iba1d7863171268066bf7597182c57a0a2041497f is checked out.
Depends-On: I1a66939d2b596094b419de40b370e79f09c85581
Bug: T221007
Change-Id: I09c27a084100b223662f84de6cbe01bebe1fe774
With I40fc8a709de96aceee14a10c973cd5b0a9a6f063 UserrightsPage
now requires the PermissionManager service to be injected.
Change-Id: Ibf3728c1e143787fb35b88ad8a8d5aabc8fadcb8
As noted in Ic22075bb5e, UserNotificationGatewayTest relies on the presence of
globals. When Ic22075bb5e is merged, UserNotificationGatewayTest will fail in
CI. This patch injects the configuration object into UserNotificationGateway.
Change-Id: I9c15a588a76a41a3ebfb59dac7f0761f756008ff
The hook (SpecialMuteModifyFormFields) is used to append
the option to mute/unmute echo notifications from a specified user.
Special:Mute handles posting and saving the fields, the only
requirement is that the field name is the same as the property
that wants to be modified, in this case 'echo-notifications-blacklist'
Bug: T220163
Depends-On: I2b3eee0802cb086091f35ecce13ae77a8e7d518d
Change-Id: I77b3ccfdce9b501eb8ecd58c0d7bbecb78029a7e
Changed `selenium-daily` npm script to only run tests tagged `@daily`
and removed `it.skip` on tests failing in beta cluster.
Bug:T227009
Change-Id: Id2edbfd941df098d326fa30ed9dc9f68e228f021
PHP doesn't care much about the name (in terms of case sensitivity)
but I think we should make sure the names of the method should be as
they're in their definition.
Change-Id: I6e38d8be64efaec4200471f2d3007275d7ddecec
To my knowledge in all the places I'm touching in this patch the new
code is functionally identical to the old one.
Change-Id: I0ffa96d2f9cb9bf932f68b689244051c96c17ad9
Class Revision is deprecated and in this patch, replaces
usage with appropriate classes; RevisionRecord, RevisionStore,
etc.
Bug: T221163
Change-Id: Icfc85167a636bef95daab236ab80113c1a3cf41b
When deleting echo_notification or echo_email_batch rows, also delete
the corresponding echo_event rows if no other echo_notification rows
or echo_email_batch rows refer to them.
Bug: T221262
Change-Id: I416ff107bd000a0cfac102408c993f8bec2d0286
Added a test that creates a new user and checks that they have a welcome message when notices is clicked.
Bug: T217051
Change-Id: Ia5808ebcedcd91f740cce646f4aa0576ef6d378f
* Clear echo_event before the test. Otherwise it contains
a 'thank-you-edit' event that offsets everything.
* Use standard $this->db
* Use standard ~~~~ signature
Bug: T67336
Change-Id: Idd09aa107d01038d03b689d9086f65a9fb7b653a
It was sort of checked in an implicit and roundabout way, in the sense
that the preferences page checks this and forces the relevant
preferences to on or off. But this was difficult to discover, and it's
not clear if this works correctly when defaults change.
Instead, explicitly check whether the requested notify type is available
for the event's category. Also rewrite the entire method to use
array_filter().
Change-Id: I9502a42fc705b2e56ef5edab433f1804f2924359
When pages are deleted or undeleted, their associated
Echo notifications also need to be marked as deleted
or undeleted. This is done by looking up the
echo_target_page table.
With this change, echo_event.event_page_id is also included
in the search. This way, all the events that don't use
target pages are also moderated when needed.
Bug: T217452
Change-Id: I277fca68ce088ab564e76ed9dfb2134ab3be4c4a
When the location on disk of an icon is known,
load its content and turn it into a data uri
for the <img> tag.
Otherwise (when it's only configured with a url),
use the url in the <img> tag.
Bonus: the rasterized icons were a bit blurry
and they are now crisp.
Bug: T55479
Change-Id: I8b5d7f09d8181f22927b8d4712505212ea1a10b1
PHPUnit 4 on HHVM is unable to create a mock for a class that uses variadic
arguments in one of its methods. Details at I0e027f5ec66 in core.
To work around this, IDatabase will continue to document it the old-fashioned
way so that Phan can analyse it correctly, and also so that PHPUnit can
mock it properly.
Change-Id: I4b8f2b8a8bb54b71d8b4836c3663f1a646ece1bd
This trait was using private fields from its host classes
($this->event, $this->language). It created a weird coupling
situation where the host class uses the trait and the trait
uses the host class. Effectively a circular dependency.
Also, phan is complaining about it in
I65ae6adc10941c05a2646e551b1baa829e4e8654
Change-Id: Ib2796b7ca62ecd7ece19583d7ca83e4252a5d878