From 5ad6ea7d48320acdceb76783f563cbd186534e76 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Tue, 5 Jan 2010 04:34:44 +0000 Subject: [PATCH] Make phpunit on Ubuntu work out-of-the-box (at least for me) and prepare for some LanguageConverter.php tests. --- tests/LocalFileTest.php | 1 + tests/README.ALTERNATIVE | 24 ++++++++++++++++++++++++ tests/SearchEngineTest.php | 5 ++++- tests/SearchMySQL4Test.php | 4 ++++ tests/bootstrap.php | 8 ++++++++ tests/phpunit.xml | 16 ++++++++++++++++ 6 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tests/README.ALTERNATIVE create mode 100644 tests/bootstrap.php create mode 100644 tests/phpunit.xml diff --git a/tests/LocalFileTest.php b/tests/LocalFileTest.php index 335b8bbe13..4b6fde46df 100644 --- a/tests/LocalFileTest.php +++ b/tests/LocalFileTest.php @@ -2,6 +2,7 @@ /** * These tests should work regardless of $wgCapitalLinks + * @group Broken */ class LocalFileTest extends PHPUnit_Framework_TestCase { diff --git a/tests/README.ALTERNATIVE b/tests/README.ALTERNATIVE new file mode 100644 index 0000000000..364d5e34b2 --- /dev/null +++ b/tests/README.ALTERNATIVE @@ -0,0 +1,24 @@ +This file describes an alternative way of testing from that in README +since the README method didn't work for me. + + - Put a LocalSettings.php in the parent directory. If you checked + out mediawiki/trunk/phase3 as a directory called mediawiki, then + this would go in your + - Install PHPUnit. I used version 3.3.16 from Ubuntu. + ("aptitude install phpunit"). + - Invoke phpunit directly instead of using make. This uses the + phpunit.xml file to run the tests. + - Fix broken tests. + - Label currently broken tests in the group Broken and they will not + be run by phpunit. You can add them to the group by putting the + following comment at the top of the file: + + /** + * @group Broken + */ + + + +NOTE: I haven't yet determined why but my PHP installation would +sometimes segfault while linting the files. PHPUnit uses "php -l" to +check file syntax. diff --git a/tests/SearchEngineTest.php b/tests/SearchEngineTest.php index 4fc4b2fa9a..8193496b19 100644 --- a/tests/SearchEngineTest.php +++ b/tests/SearchEngineTest.php @@ -2,7 +2,10 @@ require_once 'MediaWiki_TestCase.php'; -/** @todo document */ +/** @todo document + * @group Broken + */ + class SearchEngineTest extends MediaWiki_TestCase { var $db, $search; diff --git a/tests/SearchMySQL4Test.php b/tests/SearchMySQL4Test.php index 4fe4d5440c..ffb41bfd77 100644 --- a/tests/SearchMySQL4Test.php +++ b/tests/SearchMySQL4Test.php @@ -1,6 +1,10 @@ + + + . + + + + Broken + + + \ No newline at end of file -- 2.20.1