One use found in core or Gerrit extensions which was replaced.
* Block::clear() (deprecated in 1.18)
* Block::decodeExpiry() (deprecated in 1.18)
* Block::encodeExpiry() (deprecated in 1.18)
* Block::forUpdate() (deprecated in 1.18)
* Block::infinity() (deprecated in 1.18)
* Block::load() (deprecated in 1.18)
* Block::newFromDB() (deprecated in 1.18)
* Block::normaliseRange() (deprecated in 1.18)
* Block::parseExpiryInput() (deprecated in 1.18)
Change-Id: Ia8ea6b5248111326f929062346f3868a0550421b
Move the block insertion to addDBData(), and use a provider to
itterate through the test strings.
This seems like the more correct way to run these tests, although it
still seems hacky, since the db isn't cleaned up after each test.
Change-Id: Ib22ce69797ec03a61b0cc330e8572865290ebd31
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
Adds a new configuration variable ($wgApplyIpBlocksToXff), which when
enabled will scan the XFF header for IP addresses and check if any of
them have been blocked. $wgApplyIpBlocksToXff is disabled by default.
Bug: 23343
Change-Id: I3faa9c3e8107c6e46cdf21f8c18adda1f42890d7
Adds a new configuration variable ($wgApplyIpBlocksToXff), which when
enabled will scan the XFF header for IP addresses and check if any of
them have been blocked. $wgApplyIpBlocksToXff is disabled by default.
Bug: 23343
Change-Id: I3e38b94d10600a60d2d4857de54307f34c4662c4
Fix almost all occurences of the following sniffs:
Generic.CodeAnalysis.UselessOverridingMethod.Found
Generic.Formatting.NoSpaceAfterCast.SpaceFound
Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma
Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine
Generic.PHP.LowerCaseConstant.Found
PSR2.Classes.PropertyDeclaration.ScopeMissing
PSR2.Files.EndFileNewline.TooMany
PSR2.Methods.MethodDeclaration.StaticBeforeVisibility
Change-Id: I96aacef5bafe5a2bca659744fba1380999cfc37d
This caused about 200 exceptions "MWException: Error in MediaWikiLangTestCase::setUp(): $wgLanguageCode ('fr') is different from $wgContLang->getCode() (en)" on my installation.
Change-Id: I2987db68e22b27d8d36cdae118356fd7612e56a4
This commit depends on the introduction of
MediaWikiTestCase::setMwGlobals in change Iccf6ea81f4.
Various tests already set their globals, but forgot to restore
them afterwards, or forgot to call the parent setUp, tearDown...
Either way they won't have to anymore with setMwGlobals.
Consistent use of function characteristics:
* protected function setUp
* protected function tearDown
* public static function (provide..)
(Matching the function signature with PHPUnit/Framework/TestCase.php)
Replaces:
* public function (setUp|tearDown)\(
* protected function $1(
* \tfunction (setUp|tearDown)\(
* \tprotected function $1(
* \tfunction (data|provide)\(
* \tpublic static function $1\(
Also renamed a few "data#", "provider#" and "provides#" functions
to "provide#" for consistency. This also removes confusion where
the /media tests had a few private methods called dataFile(),
which were sometimes expected to be data providers.
Fixes:
TimestampTest often failed due to a previous test setting a
different language (it tests "1 hour ago" so need to make sure
it is set to English).
MWNamespaceTest became a lot cleaner now that it executes with
a known context. Though the now-redundant code that was removed
didn't work anyway because wgContentNamespaces isn't keyed by
namespace id, it had them was values...
FileBackendTest:
* Fixed: "PHP Fatal: Using $this when not in object context"
HttpTest
* Added comment about:
"PHP Fatal: Call to protected MWHttpRequest::__construct()"
(too much unrelated code to fix in this commit)
ExternalStoreTest
* Add an assertTrue as well, without it the test is useless
because regardless of whether wgExternalStores is true or false
it only uses it if it is an array.
Change-Id: I9d2b148e57bada64afeb7d5a99bec0e58f8e1561
This patch adds BlockTest::testBlockedUserCanNotCreateAccount() which
test that a new user can createaccount and that blocking him will
prevents to the createaccount right.
Does not solve bug 38333 though!
Change-Id: Ia10e26825d50d47b4770900ee91dea666337f969
Change 1:
* Delete any pre-existing block for the tests
* Renamed test function and fixed comment typo
Change-Id: I4804ccae81dd0455e9d3ddf48960c4b5cd6e4f5f
difference.
Otherwise if the test happens to be run on a second barrier, it could
falsely fail (like it did just now when codur said some hurtful things
about my code failing unit-tests where it really didn't ;)
Some of the other block tests seem to itermitantly fail for no appearent
reason (null comes back instead of the block)... I don't know why.
It was accidentally passing a username where it should have passed a user ID, causing PostgreSQL's stricter comparisons to fail, while MySQL's allowed it to run without complaint but returned bad results.
Of course that bug got hidden by the test.... testing the wrong thing... :)
Now correctly loads using the user id instead of name, checks the proper return values, and actually compares the right object.
The ID might be different than the one you expect. Since r88755 the tables
are no more dropped and recreated, thus the autoincrement pointer is not
reset. A previous test could have raised that pointer, thus the id might
be above the expected value.
This patch track the block ID inserted and use it in the assertion.
Fixes regression from r84475 and friends which made Block->load() and its new front-end Block::newFromTarget() fail when an empty string was passed in as the IP / $vagueTarget parameter to indicate skipping IP-based lookups.
Added phpunit test cases to confirm that both Block->load() and Block::newFromTarget() work when given null (already ok), '' (as done from CheckUser), or false (not seen, but perfectly legit sounding).
Adjusted comparisons to work as expected.
Don't setup/destroy for databaseless tests.
Make needsDB() return based on the DocComment.
Delayed db init until the test is run, so that it isn't set for excluded tests (the exclusion is done after all the classes are instantiated).