Commit graph

24 commits

Author SHA1 Message Date
Antoine Musso
aeacaae2b2 (bug 38333) test blocked user cant createaccount
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
2012-07-19 08:19:15 +00:00
Aaron Schulz
e82c2cc7ee Merged r114672 from wmf1.19 plus tests; crosswiki block name/id fix.
Change 1:
* Delete any pre-existing block for the tests
* Renamed test function and fixed comment typo

Change-Id: I4804ccae81dd0455e9d3ddf48960c4b5cd6e4f5f
2012-04-10 09:49:52 -07:00
Aaron Schulz
ea6b51694e r112563: Removed random bogus user IDs passed into to Block constructor in tests 2012-02-28 02:32:59 +00:00
Max Semenik
7abd9f4abd Simplify r101365, this cruft is not really needed 2011-10-31 17:00:29 +00:00
Max Semenik
7e917c79b3 Fixed annoying intermittent BlockTest failures. No surprise we had 'em since blocks set to expire RIGHT NOW tend to expire at that very time:) 2011-10-31 16:54:42 +00:00
Brian Wolff
697487da5e Make testBug26425BlockTimestampDefaultsToTime be tolerrant of up to 2 seconds
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.
2011-08-18 06:23:44 +00:00
Chad Horohoe
bb2b97b39d Mostly revert r89400: not needed since Brion fixed the tests in other ways 2011-08-08 16:08:48 +00:00
Aaron Schulz
a108dbfe8f Reverted r92489 and added/use hideDeprecated() to MW test framework 2011-07-25 16:27:33 +00:00
Aaron Schulz
dac8655a58 Removed testBug29116LoadWithEmptyIp. Fails due to wfDeprecated() call in load() and nothing uses that so it's not worth it. 2011-07-18 22:30:38 +00:00
Mark A. Hershberger
780ba99ac8 random eol w/s annoys me. 2011-06-26 20:04:38 +00:00
Brion Vibber
13b1da185e * (bug 29426) Fix wrong use of Block::load's second parameter in BlockTest
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.
2011-06-16 17:58:26 +00:00
Brion Vibber
15445510ff Fix for BlockTest -- when setup ran multiple times, the block entry wouldn't get re-saved and we'd end up with null or 0 as our block id.
By first removing any matching block, we can re-insert it at will and have a fresh working block to test.
2011-06-15 20:43:24 +00:00
Platonides
3399ffa031 BlockTest changes $wgContLang, too. 2011-06-14 21:27:07 +00:00
Chad Horohoe
cb569f094f Fix some of the weird freaky interaction between ApiBlockTest and BlockTest.
* By using the same summary for both, we allow both sets of tests to pass with --filter Block
* Just testing includes/BlockTest.php still passes
2011-06-03 06:22:18 +00:00
Chad Horohoe
6f7e2eb71e Followup r89311: rv unrelated changes 2011-06-02 01:28:30 +00:00
Chad Horohoe
89529808d8 Make user right selection in installer actually work, thanks Krinkle for spotting this 2011-06-02 01:26:26 +00:00
Chad Horohoe
5004f09bfa Exclude Block tests until somebody fixes them, also cache listTables() result so we can skip some queries 2011-06-01 22:54:33 +00:00
Antoine Musso
6642e733c6 Use the correct ID when retrieving a block
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.
2011-05-28 21:25:29 +00:00
Brion Vibber
536fad8f90 * (bug 29116) Fix regression breaking CheckUser extension
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.
2011-05-24 21:04:50 +00:00
Platonides
fe7ee51f3c Follow up r87210 2011-05-01 23:02:27 +00:00
Happy-melon
cf08b61b1b Follow-up r84475: fixing the warning is easy enough... :D Also some random tweaks to Database.php documentation. 2011-03-21 23:03:11 +00:00
Platonides
84709ae3b3 Follow up r79109.
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).
2010-12-29 15:01:47 +00:00
X!
c4befaf28c Add test to supplement Bug 26425 (followup to r79013) 2010-12-28 19:27:34 +00:00
X!
a9ff87335f Add BlockTest unit test 2010-12-28 19:12:27 +00:00