Commit graph

22 commits

Author SHA1 Message Date
Platonides
2e33fb3ff6 Finally commit the testing stuff I have been with this week. Could be considered a continuation of r79411.
Mixture of the NewParserTests.php with old code present in MediaWikiParserTest.php, reverting r79184 (revert of a revert...) and even eval().
Using the iterator as dataProvider, but defering the insertion of articles, as the dataprovider is processed on load, before switching dbs.
Each parser test appear now as a phpunit test. This means that by adding 683 tests (partly from extensions) we now surpass two thousand tests.
The downside of that is that they become painfully slow.
Initialise $wgHooks to $wgHooks, not to array() (r82499) as otherwise we lose ParserFirstCallInit registrations.
There's no attempt to support extensions registering to $wgParser instead of using ParserFirstCallInit properly (Cite falls in this category).
2011-02-26 21:49:42 +00:00
Platonides
4ef087080d maintenance/commandLine.inc loads DefaultSettings, LocalSettings and then runs Setup.php
As Setup.php assigns variables based on the cache config, bootstrap.php was late on reseting them, as some objects were already created.
So we could end up with a SqlBagOStuff created there, which when later accessed (such as trying to invalidate the cache for a user) would 
-as any non-sqlite SqlBagOStuff- open a new db connection. Which is precisely what we shall not be done when dealing with temporary tables
(and would indeed fail miserably due to not finding unittest_objectcache table).

In summary, reenabling temporary tables disabled in r79411.
2011-02-21 23:19:26 +00:00
Platonides
74b466ae9c Spaces to tabs 2011-02-20 17:52:09 +00:00
Platonides
ee25269cf3 Fix the completely broken r81880 2011-02-10 10:03:38 +00:00
Platonides
4a01e74356 Add support of assertEmpty (used since r81596) for phpunit < 3.5.0 2011-02-10 09:51:31 +00:00
Antoine Musso
ba4a69e0e2 Fix @dataProvider with PHPUnit 3.5.8+
MediaWikiTestCase duplicates code from PHPUnit constructor. It worked
fine until PHPUnit 3.5.8 made FrameWork_TestCase attributes private,
thus the children class is no more able to update them ($data for example)
The change break any tests making use of the @dataProvider helper.

PHPUnit commit:
0b85d08c39

TESTS:
3.5.7  : OK -> OK
3.5.8  : KO -> OK
3.5.10 : KO -> OK

make databaseless
Tests: 486, Assertions: 73986, Incomplete: 1, Skipped: 3.

(skipped tests are SQLite related)
2011-02-05 16:25:18 +00:00
Alexandre Emsenhuber
de4a9c6b9a Reset the cache used in User::idFromName(), otherwise tests will try to add the user '127.0.0.1' multiple times, resulting in a database error (duplicate key for user_name field) 2011-01-25 16:32:43 +00:00
Jure Kajzer
f853d711ac * fixed Oracle code for installer and phpunit tests
* removed ORABlob class
2011-01-10 19:22:27 +00:00
Chad Horohoe
d71167fa60 Move table prefixes to constants, add doc to addDBData() 2011-01-10 18:34:59 +00:00
Platonides
1cb56fc8e3 Remove unused globals 2011-01-01 22:16:58 +00:00
X!
f8d74604fd More work on new parser tests:
-No need to specify a new function for each argument, use PHP5 magic to automatically set it
-Create (g|s)etCliArg() functions
-Implement some features from the old parser tests
2011-01-01 05:53:04 +00:00
X!
34fc833407 Start work on porting ParserTests completely into PHPunit.
Disable temporary tables, a few reports of them not working. The tables get deleted anyway, so why risk it?
2011-01-01 03:39:37 +00:00
X!
2441c2d5e4 For some reason tableExists() is being unreliable, which is resulting in tables not being dropped that _should_ be dropped. Drop them anyway and ignore the errors. 2010-12-31 21:51:21 +00:00
X!
a26353ec0b -If $this->db does not exist, skip destroying the DB
-Fix ApiTest errors due to DB rewrite
2010-12-31 21:40:26 +00:00
X!
02077c9901 Add check to make sure only MySQL and SQLite are used at the moment. These two are the only ones with the listTables() function, and the only ones that are tested. 2010-12-31 21:10:36 +00:00
X!
90e371195e Only destroy DB if it needs it 2010-12-31 21:05:51 +00:00
X!
1b7bfdee49 I made MySQL work, and broke SQLite in the process. I fix SQLite, and made MySQL break. Fixing MySQL again, hoping that SQLite works too. :) 2010-12-31 21:01:17 +00:00
X!
025defad3f Solved problem with SQLite: Globals were getting stored, and when a PDO reference is transferred, as is the case with SQLite, it serializes the globals. 2010-12-31 20:47:48 +00:00
X!
dd68f3947a More work on getting SQLite to work with unit tests. DB Prefix changing is now static to allow for external classes to change it. 2010-12-31 20:42:39 +00:00
X!
1993c83277 -Destroy the DB automatically when initting the DB
-Add $force option to wfSetVar
-More work on getting SQLite to work
2010-12-30 17:30:35 +00:00
Platonides
c97d18b7ea Follow up r79109. Do not use create_function. 2010-12-30 16:24:29 +00:00
Platonides
4cb81e08f4 Move MediaWikiTestCase class to a new file and load it from phpunit.php
This restores the ability to run single tests with 
php phpunit.php includes/filename.php
2010-12-29 15:52:07 +00:00