Commit graph

4 commits

Author SHA1 Message Date
saper
162d096eb5 Don't assume test user has ID 1 in SpecialPageTest
SpecialPageTest seems to assume
the first database user has ID number 1.

In case of the current PostgreSQL test
setup it does not have to be the case.

This query:

Query pgtest01 (101) (slave):
SELECT /* User::loadFromDatabase 127.0.0.1
*/  user_id /* more fields */ FROM "unittest_mwuser"
WHERE user_id = '1'  LIMIT 1

fails, because UTSysop has been added by the
test setup before with some other ID:

Query pgtest01 (65) (slave):

INSERT /* User::addToDatabase 127.0.0.1 */
INTO "unittest _mwuser"
	(user_id,user_name /* more fields */
VALUES ('322','UTSysop' /* more values */

Change-Id: I7b0a6a9001765111669051d57e675e588b71ba17
2013-12-06 13:48:22 +01:00
aude
71cf107f99 Make setUp and tearDown protected in tests
These are protected in the parent MediaWikiTestCase and
PHPUnit_Framework_TestCase. No good reason to make them public.

Change-Id: I45ecc0e4209f0c3b27e63a550112e4e0ddf6e530
2013-11-24 01:48:09 +01:00
aude
21cf1fb88f Add tests for SpecialPage::requireLogin
Change-Id: Id9ee08c921a3e109e5175bb7ae807615cb15b8e5
2013-11-19 23:24:27 +01:00
aude
d093453e7e Remove unused exception in SpecialPage::getTitleFor and add tests
The way the existing code was, it seems the exception condition
was never hit, as one could enter a bogus special page title in
SpecialPage::getTitleFor and it returns a Title object anyway.

Some tests are also added for SpecialPage::getTitleFor(),
although more refactoring my be required to truly unit test this,
vs. indirectly testing other stuff via static methods.

Change-Id: I6e427d047a2f8e58677eb65b50866f767078c255
2013-11-16 20:48:47 +01:00