Initally used a new sniff with autofix (T333745),
but some provide are defined non-static in TestBase class
and need more work to make them static in a compatible way
Bug: T332865
Change-Id: I889d33424f0c01fb26f2d86f8d4fc3de3e568843
- Strengthen types
- Use StatusValue instead of Status
- Extract duplicated code to a new private method
- Add MailAddress::equals to compare addresses, instead of relying on
the weak '!=' comparison. There might be a question of whether having
the same address should be enough for two MailAddress objects to be
equal, but the implementation in this patch preserves the status quo.
- Make the new validateTarget accept a User object directly. This is
better than passing strings around just to have the "validator" create
a user for you.
- Avoid returning false if there's a hook error in submit(). Accepting 5
different error formats in the same hook is simply unreasonable, and
this should eventually be standardized to use StatusValue. The old
methods in SpecialEmailUser retain BC.
Bug: T265541
Change-Id: Ia0ba27fe634e328dff1a6c06fb9979cb8ce4f7e7
Requires a bit of manual manipulation of globals, but
other than than no reason to make an integration test.
Change-Id: I56342770f856092992660e104e06aa65a24e0e20
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)
My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.
Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
Otherwise, names that contain whitespace (but no special characters
that need Q-encoding) will be sent as-is in an email header. While
that's valid by RFC 1036, RFC 5322 and others, some mail programs
fail to correctly process spaces. Avoid these problems by simply
quoting the name always - except for cases which are Q-encoded,
which must remain unquoted to be valid (and also cannot contain
spaces, thus unaffected).
Before:
> From: Foo Bar <fb@example.org>
After:
> From "Foo Bar" <fb@example.org>
Update test to work with the new criteria.
Bug: T191931
Change-Id: I4b2a0a80e8b43ecc943939fc5ebaa356a4f840e0
The default will remain PHPUnit 4.x due to PHP 5.5 support.
But, we should allow developers to run tests with newer PHPUnit
versions which are noticably faster (especially for code coverage
reports).
* <https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.4.0>
PHPUnit 5 deprecates the getMock() shortcut for getMockBuilder()->getMock().
It instead introduces the shortcut createMock() which has better defaults
than getMockBuilder(). For example, it sets 'disableArgumentCloning' and
other things by default.
Going forward, code should either use getMockBuilder directly and configure
it using the setter methods (instead of the confusing variadic arguments
of getMock) or simply use the new minimalistic createMock method. This patch
backports the createMock method to MediaWikiTestCase so that we can start
using it.
Change-Id: I091c0289b21d2b1c876adba89529dc3e72b99af2
- Added newline at end of file
- Removed double spaces/newlines
- Added space after if/function and parentheses/brackets
- Removed space before comma/cast
- Fixed indent of some lines
Change-Id: I29867ffdffdfb7d2b56997e9393497c7dc12f7d3
1) MailAddressTest::testNewFromUser
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Real name <foo@bar.baz>'
+'foo@bar.baz'
Change-Id: I0c9724130730c39a355c22d06b2c0f0629c1d0e3