Refactor ApiTestCase to get token from ApiQueryTokens
[lhc/web/wiklou.git] / tests / phpunit / README
index ce78270..f555812 100644 (file)
@@ -1,35 +1,50 @@
 == MediaWiki PHPUnit Tests ==
 
-Some quickie unit tests done with the PHPUnit testing framework. To run the
-test suite, run 'make test' in this (maintenance/tests/phpunit) directory.
+The unit tests for MediaWiki are implemented using the PHPUnit testing
+framework and require PHPUnit to run.
+
 
 === WARNING ===
 
-The current versions of some of these tests are DESTRUCTIVE AND WILL ALTER
-YOUR WIKI'S CONTENTS. DO NOT RUN ON A PRODUCTION SYSTEM OR ONE WHERE YOU
-NEED TO RETAIN YOUR DATA.
+Some of the unit tests are DESTRUCTIVE and WILL ALTER YOUR WIKI'S CONTENTS.
+
+DO NOT RUN THESE TESTS ON A PRODUCTION SYSTEM OR ON ANY SYSTEM WHERE YOU NEED
+TO RETAIN YOUR DATA.
+
+
+== Installation ==
+
+If you used composer to install MediaWiki's dependencies PHPUnit will already be available, unless
+you explicitly specified the --no-dev flag during the install. In this case just run "composer update".
+
+Otherwise follow the installation instructions in the
+PHPUnit Manual at:
+
+  https://phpunit.de/manual/current/en/installation.html
+
+
+== Running tests ==
+
+The tests are run from your operating system's command line.
+
+Ensure that you are in the tests/phpunit directory of your MediaWiki
+installation.
+
+
+On Unix-like operating systems, the tests runs are controlled with a makefile.
+Run command:
+
+  make help
+
+for a full list of options for running tests.
 
-=== Installation ===
 
-PHPUnit is no longer maintained by PEAR. To get the current version of
-PHPUnit, first uninstall any old version of PHPUnit or PHPUnit2 from PEAR, 
-then install the current version from phpunit.de like this:
+On Windows-family operating systems, run the 'run-tests.bat' batch file.
 
- pear channel-discover pear.phpunit.de
- pear install phpunit/PHPUnit
 
-You also may wish to install this via your normal package mechanism:
+=== Writing tests ===
 
- aptitude install phpunit
-- or -
- yum install phpunit
+A guide to writing PHP unit tests for MediaWiki can be found at:
 
-=== Notes ===
+       https://www.mediawiki.org/wiki/Manual:PHP_unit_testing
 
-* 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
-  */
-* Need to fix some broken tests