Manual talk:PHP unit testing/Installing PHPUnit

From MediaWiki.org
Jump to navigation Jump to search

It doesn't look to me like the apt-get installer is broken anymore with Ubuntu 12.04. See User:Leucosticte/Broken? Never mind, it really is broken as described. Leucosticte (talk) 06:43, 30 October 2012 (UTC)

What about Ubuntu 13.10?[edit]

Is that one broken too? Leucosticte (talk) 03:23, 9 November 2013 (UTC)

Mbstring and other non-standard PHP modules and dependencies[edit]

Yeah, you should check whether you have installed mbstring on your CLI version of PHP!

$ php -r "phpinfo();" | grep "mbstring"

On openSUSE, you can install that with (only the first command is mandatory as phpunit otherwise quits with a fatal error):

$ zypper in php-mbstring
$ zypper in php-exif
$ zypper in php-intl
$ zypper in php-zlib
$ zypper in php-tidy
$ zypper in php-dba
$ zypper in DjVuLibre

XDiff is a more tricky one.

$ cd /tmp
$ wget http://www.xmailserver.org/libxdiff-0.23.tar.gz
$ tar xvfz libxdiff-0.23.tar.gz
$ cd libxdiff-0.23
$ ./configure
$ make
$ sudo make install
$ cd ..
$ rm -r libxdiff-0.23
# Version 1.4 simply does not work
$ wget http://pecl.php.net/get/xdiff-1.5.2.tgz
$ tar xvfz xdiff-1.5.2.tgz
$ cd xdiff-1.5.2
$ ./configure
$ make
$ sudo make install
$ cat /etc/php5/cli/php.ini | grep "\.so"
# ... Installing shared extensions:     /usr/lib64/php5/extensions/
# Add the freshly installed dynamic library to your php.ini
$ sudo vim /etc/php5/cli/php.ini # "/\.so" | [i] | add "extension=xdiff.so;" | [Esc] | [w][q] | [Enter]
# make sure the xdiff library can be found
$ sudo ln -s /usr/local/lib64/libxdiff.so /usr/lib64/libxdiff.so
# test it
$ php -r "phpinfo();" | grep "xdiff"
# clean up
$ cd ..
$ rm -r xdiff-1.5.2

-- Rillke (talk) 22:01, 24 July 2014 (UTC)