User:Mainframe98/Vagrant
Appearance
This page describes how to do certain things on MediaWiki-Vagrant.
Running unit tests
[edit]I recommend creating a quick script:
#!/bin/bash
export PHPUNIT_WIKI=wiki
cd /vagrant/mediawiki
composer phpunit:entrypoint "$@"
Using phpunit.php (deprecated)
[edit]#!/bin/bash
export PHPUNIT_WIKI=wiki
php /vagrant/mediawiki/tests/phpunit/phpunit.php "$@"
Generating test coverage
[edit]I recommend creating a quick script:
#!/bin/bash
export XDEBUG_MODE=coverage
export PHPUNIT_WIKI=wiki
cd /vagrant/mediawiki
composer phpunit:entrypoint --coverage-html /vagrant/mediawiki/docs/coverage "$@"
This will enable coverage for XDebug 3, allowing you to keep it disabled when not using coverage-related features (#Unborking Xdebug).
Using phpunit.php (deprecated)
[edit]#!/bin/bash
export XDEBUG_MODE=coverage
export PHPUNIT_WIKI=wiki
php /vagrant/mediawiki/tests/phpunit/phpunit.php --coverage-html /vagrant/mediawiki/docs/coverage "$@"
Phan
[edit]- You can now enable phan with vagrant roles enable phan, which does all the preparation work. Then invoke with composer phan.