Commit graph

22 commits

Author SHA1 Message Date
Chad Horohoe
950368c7e8 Remove phpunit profiling. It doesn't make any sense
Change-Id: I7aa98ddc0a80f931a685e2946e61aa4a7dfdabff
2015-02-10 18:50:52 +00:00
addshore
9d69b15958 Move profile In/OUT call out of MWPHPUnitCommand
Change-Id: I710fddc20e88745c9091432dff87b5e361c1f71a
2014-05-05 12:55:56 +00:00
addshore
159dc79049 Move teardownTestDB and wfLogProfilingData out of MWPHPUnitCommand
Change-Id: Ic175c1457e7f76a2b5232a2b5d3563c5982cfee2
2014-05-05 13:55:42 +01:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
Alexandre Emsenhuber
4742232b0d Fix bootstrap in unit tests
- Remove check for version, that version is already enforced in phpunit.php,
  so there is not point showing a warning for it is useless
- Remove call to MessageCache::destroyInstance(), there is no need for it,
  since $wgMessageCacheType is set in phpunit.php before running Setup.php
- Remove includes of bootstrap.php in LanguageSrTest.php and LanguageUzTest.php

Change-Id: I4b2db6b3e6f001175e1a407c5add2972aade5e60
2013-05-03 21:45:06 +02:00
Siebrand Mazeland
791d0b2a98 Update code formatting
Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
2013-04-26 14:21:20 +00:00
Siebrand Mazeland
ac63001d8e Update formatting
1 of n.

Change-Id: I852729f08bbb0c5e39c2db44362ccdc7f59dcc08
2013-02-14 12:22:13 +01:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00
Christian Aistleitner
096592cf14 Bumping minimum supported version of PHPUnit to 3.6.7
With PHPUnit 3.6.7, we can finally check the output of tests.

Change-Id: Ib0f1afe5fd9ab9784ba7f78b2921cf047ccc83f3
2012-04-29 10:02:23 +02: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
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Platonides
71ee20cd18 Move $wgLocalisationCacheConf disabling from bootstrap.php to phpunit.php 2011-01-21 22:44:40 +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
Platonides
d74edea7e4 Follow up r79107 for old PHPUnit versions. 2010-12-29 15:21:25 +00:00
Platonides
00df670538 Fix the DELETE FROM unittest_objectcache WHERE keyname = 'my_wiki-unittest_:user:id:1 error 2010-12-29 15:11:44 +00:00
Platonides
79eb9b5bdf Follow up r79173. Pass the parameters in the right order. 2010-12-29 15:08:29 +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!
edbf743aeb Make MediaWikiParserTest work now in PHPUnit. There are still a few bugs, such as stopping tests if one fails,
lack of fuzz testing and other parser test options, and the DB creation is still a little flaky.
A MediaWikiPHPUnitCommand class had to be created to allow for custom CLI parameters.
2010-12-29 02:23:51 +00:00
X!
d5866d9ef2 Followup to r79109: Use a clean DB by default for each test 2010-12-28 18:10:18 +00:00
Chad Horohoe
5f528203aa Rename MediaWikiTestSetup to MediaWikiTestCase: this is going to be the base class for all unit tests from now on 2010-12-28 17:45:33 +00:00
X!
86df2d2755 It's here! It's finally here! The skies are falling, pigs have sprouted wings, and it's pretty cold in hell!
-Add a working PHPUnit test that instantiates a new DB, adds set data, and deleted when done.
-Add listTables() to the Database classes (only MySql and SQLite use it, and only MySQL is tested)
2010-12-28 17:15:50 +00:00
Chad Horohoe
23f69f10ed Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're not strictly maintenance scripts, and some people want to do a selective checkout that doesn't include the tests. There's still debate on whether we should include these in the release downloads, but we had a pretty firm consensus to move this. 2010-12-14 16:26:35 +00:00