Difference between revisions 580483 and 585567 on mediawikiwiki{{Manual:PHP_unit_testing/navigation}} You must have PHPUnit 3.6.7 (or later) installed to run the unit tests. Most developers uses the very latest PHPUnit version, so there is no guarantee an older one will actually pass the tests we wrote. {{notice| Depending on your distribution and configuration, you may have to run the following commands with <code>sudo</code>. }} == Install methods == Several methods are available to you. === MediaWiki PHPUnit installer === We provide a shell script for Unix-like operating systems (Ubuntu, Mac OS X, Linux...). The script will attempt to install PHPUnit using various methods and usually manage to get it installed. It will try [http://pear.php.net PEAR], falling back to the [[w:Advanced Packaging Tool|apt]] and [[w:Yellowdog Updater, Modified|yum]] package managers. The script is located in <tt>tests/phpunit</tt> and requires root access. Example installing PHPUnit under an Unix system: <source lang="bash"> $ cd tests/phpunit $ sudo ./install-phpunit.sh </source> This might be the easiest way to install PHPUnit. === Using a package installer === Several Linux distributions provide phpunit as a package, so you can install it using your distribution's package manager or software center GUI. For example, in Debian and Ubuntu you can enter <source lang="bash"> $ sudo apt-get --no-install-recommends install phpunit </source>⏎ ⏎ === Using PEAR === PEAR is a package manager for PHP, the MediaWiki PHPUnit installer attempt to use it as a first method. You will obviously need to install pear first. <source lang="bash"> $ sudo pear channel-discover pear.phpunit.de $ sudo pear channel-discover components.ez.no $ sudo pear channel-discover pear.symfony-project.com $ sudo pear update-channels (contracted; show full) This is [[:bugzilla:35110|bug 35110]] and [https://bugs.php.net/bug.php?id=61358 PHP#bug 61358]. This might happen when using version of [http://pecl.php.net/package/xdiff pecl-xdiff PHP extension] older than 1.5.2 with PHP 5.3.10+. To fix, please upgrade pecl-xdiff extension to [http://pecl.php.net/package-changelog.php?package=xdiff version 1.5.2 or newer]. The '''xdiff''' tool is not affected by this problem. == Notes == <references /> All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://mediawiki.org/w/index.php?diff=prev&oldid=585567.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|