test: helper to skip tests depending on a PHP ext
authorAntoine Musso <hashar@free.fr>
Mon, 28 Jan 2013 09:27:31 +0000 (10:27 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 28 Jan 2013 11:18:04 +0000 (11:18 +0000)
commita7901801b4cba6e5a2e543497f0b173a86e1a58b
treeaebf48314920dfde5932ee03c05c18abc38409c0
parentcbf79c54bfbb39d58704d83de5453d9353e8317f
test: helper to skip tests depending on a PHP ext

Some of our tests expect a specific PHP extension to be loaded to get
anything done, for example zlib or gd.  This patch creates a new helping
method that people can use to easily skip a test whenever a PHP
extension is not around: MediaWikiTestCase::checkPHPExtension()

Example usage:

 function testCompressFiles() {
   $this->checkPHPExtension( 'zlib' );
   ...
 }

Change-Id: Ia87317ca379b2d5d1d1fa4231f76033ee66086c2
tests/phpunit/MediaWikiTestCase.php