Also added MediaWikiTestCase::assertType which accepts both internal types, classes and interfaces
Change-Id: I168ef17ad2da3b744a106742760ef34cc683bf69
Very trivial helper to compare HTML content. The method just add a
newline after each closing angle and then call assertEquals().
Change-Id: I5e6daa916a4fb452824616fa3c8a87bdb8038e8c
MediaWikiTestCase::teardown() will now rollback any transactions
left open by a test case. This is intended to make sure tests do
not provide "interesting" results casued by transaction state
leaking from other tests.
Change-Id: Ia225251efd5aafbaa6674e2732ab1ba7761bfadc
The ORDER BY should be at $options.
This was throwing errors in PHP 5.4 due to the array being
converted to a string down at Database.php:862
Fixes 50ee1d2
Change-Id: Ifb0fc70144242f25fc916fb8d380ed3e2d334fb9
This test case is intended to test the updating of various links
tables using a LinksUpdate object, based on the information in
a ParserOutput object.
Patch set 3: Suggestions by Aaron:
factored assertSelect() out into MediaWikiTestCase.
Force sorting of result set under testing.
Change-Id: I2d01e67ee7396080a04e5dff637aca0dc159c65d
If the test says it uses database tables, then it needs the database.
And while we are at it, make the check for the test group declaration
more lenient.
Patch set 2: tweaked according to demon's comments.
Change-Id: Ib123745d45b85cebeab5ec87ea7d8227ec3d1dea
* CloneDatabase - already droping tables in internal function, removed duplicate action
* DatabaseOracle - stopped ignoring "temporary" parameter
* added two parameters to phpunit (use-normal-tables & reuse-db), default actions stay the same
* with reuse-db oracle phpunit test run on oracle down to 1m 20s ;)
phase3/includes/upload/UploadBase.php:620
phase3/tests/phpunit/includes/UploadTest.php:120
phase3/tests/phpunit/includes/UploadTest.php:55
phase3/tests/phpunit/includes/UploadTest.php:35
$wgContLang not needed, TitlePermissionTest.php changes the language, inheriting from MediaWikiLangTestCase
* Fix Oracle stuff per CR on r88755
* Don't expect tests to clean up after themselves, do it in MediaWikiTestCase::run() (skipping user and interwiki, also per CR)
** Also don't do it from the destructor, phpunit calls this more often than you'd think
* Need to find: way to detect "is this the last test?" so we can drop our tables on completion
Now just create them on the first test that needsDB() and skip creation on the rest.
Leaves you with a bunch of useless tables at the end of a run, but oh well at least its faster :)
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).
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.
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)