Last modified: 2010-11-12 12:54:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 699 - Write unit tests for various bits of code (PHPUnit)
Write unit tests for various bits of code (PHPUnit)
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: code_quality
  Show dependency treegraph
Reported: 2004-10-12 18:06 UTC by Brion Vibber
Modified: 2010-11-12 12:54 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Fix breakage in unit tests (10.27 KB, patch)
2006-08-22 05:31 UTC, Wil Mahan
Take 2 - don't die horribly if LocalTestSettings.php is not set up (14.92 KB, patch)
2006-08-22 06:10 UTC, Wil Mahan

Description Brion Vibber 2004-10-12 18:06:53 UTC
While we've started on parser tests, and the Unicode normalization class has its
own test suite, there's still a lot of code with no automated, objective tests.

It would be nice to have a set of unit tests, perhaps using the PHPUnit/PHPUnit2
package (it's in PEAR) to test various functions and classes. This would also
encourage refactoring code in less global-dependent ways.
Comment 1 Wil Mahan 2006-08-22 05:31:37 UTC
Created attachment 2263 [details]
Fix breakage in unit tests

It looks like Brion started on some tests but they
since became out of date. Here is a patch that makes
them work again.

To summarize, I removed the Latin-1 encoding tests
and support for MySQL v3, removed references to a
renamed profiling include file, modified
SearchMySQL4Test to use a new results interface,
and modified the database tests to create a
connection, which is now required required even
for simple operations like the addslashes()

With the patch all 40 tests pass, at least for me.
I'm using PHPUnit 1.3.2.
Comment 2 Wil Mahan 2006-08-22 06:10:21 UTC
Created attachment 2264 [details]
Take 2 - don't die horribly if LocalTestSettings.php is not set up
Comment 3 Antoine "hashar" Musso (WMF) 2010-11-12 12:54:07 UTC
Marking this bug resolved since we now have PHPUnit tests. Although the current coverage is far from being complete ...

Note You need to log in before you can comment on or make changes to this bug.