aboutsummaryrefslogtreecommitdiffstats
path: root/posts
diff options
context:
space:
mode:
authorFran├žois Kooman <fkooman@tuxed.net>2017-01-12 22:32:53 +0100
committerFran├žois Kooman <fkooman@tuxed.net>2017-01-12 22:32:53 +0100
commit03cb4ae7134e10aaea86f9a5b1109e7aea513966 (patch)
treeff71207923682a5da8c14638d9f3936913311d8d /posts
parent6c24c8625db5b310a775c9b6c881b2bef99cecb1 (diff)
downloadwww.tuxed.net-03cb4ae7134e10aaea86f9a5b1109e7aea513966.zip
www.tuxed.net-03cb4ae7134e10aaea86f9a5b1109e7aea513966.tar.gz
www.tuxed.net-03cb4ae7134e10aaea86f9a5b1109e7aea513966.tar.xz
new post
Diffstat (limited to 'posts')
-rw-r--r--posts/phpunit_xdebug.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/posts/phpunit_xdebug.md b/posts/phpunit_xdebug.md
new file mode 100644
index 0000000..9dc0933
--- /dev/null
+++ b/posts/phpunit_xdebug.md
@@ -0,0 +1,31 @@
+---
+title: PHPUnit and Xdebug
+published: 2017-01-12
+---
+
+Having the [Xdebug](https://xdebug.org/) PHP extension always loaded slows
+down [Composer](https://getcomposer.org/) and
+[Phan](https://github.com/etsy/phan).
+
+But I do want to have Xdebug enabled for generating code coverage reports using
+[PHPUnit](https://phpunit.de/).
+
+It took me some time to figure this out, but the deal is: install the Xdebug
+extension, on Fedora:
+
+ $ sudo dnf -y install php-pecl-xdebug
+
+Edit the file `/etc/php.d/15-xdebug.ini`:
+
+ ;zend_extension=xdebug.so
+
+Now, to enable this extension _just_ for running PHPUnit:
+
+ $ php -dextension=/usr/lib64/php/modules/xdebug.so /usr/bin/phpunit \
+ --coverage-html coverage
+
+To automate this, add the following `alias` to your `$HOME/.bashrc`:
+
+ alias phpunit="/usr/bin/php -dextension=/usr/lib64/php/modules/xdebug.so /usr/bin/phpunit"
+
+It was surprisingly hard to figure this out, hope it helps someone!