PHPUnit/VSCode: Difference between revisions

From Freephile Wiki
Created page with "This project looks very interesting. I need to check it out. https://github.com/elonmallin/vscode-phpunit Category:Wiki Category:MediaWiki Category:Development Category:QA Category:Testing Category:Static Analysis Category:Tools Category:Continuous Integration"
 
link to more detailed docs
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This project looks very interesting. I need to check it out.
This project looks very interesting. I need to check it out.
https://github.com/elonmallin/vscode-phpunit
https://github.com/elonmallin/vscode-phpunit
== Getting PHPUnit to work inside Docker with VSCode ==
The SemanticMediaWiki project uses the [https://github.com/gesinn-it-pub/docker-compose-ci Gesinn IT docker compose CI] system (see [[Using docker-compose-ci]]) for testing locally (and through [[GitHub/Actions]])
But to get it to work with VSCode, I needed to
* <code>make install</code>
* <code>make prepare-dev</code>
* <code>make bash</code>
* <code>export XDEBUG_SESSION=1</code><ref>https://xdebug.org/docs/step_debug#troubleshoot</ref> in the terminal before hitting 'Listen for XDebug' in VSCode (which was attached to the running container).
After it is all working and you want to invoke PHPUnit, you can either do it directly, or through [[composer]]
<pre>
# these are equivalent
composer phpunit -- -c phpunit.xml.dist --bootstrap tests/bootstrap.php --filter testTranscludeAnnotationWithoutUniquidThrowsException
php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist --bootstrap tests/bootstrap.php --filter testTranscludeAnnotationWithoutUniquidThrowsException
</pre>





Latest revision as of 13:57, 26 November 2025

This project looks very interesting. I need to check it out. https://github.com/elonmallin/vscode-phpunit

Getting PHPUnit to work inside Docker with VSCode

The SemanticMediaWiki project uses the Gesinn IT docker compose CI system (see Using docker-compose-ci) for testing locally (and through GitHub/Actions)

But to get it to work with VSCode, I needed to

  • make install
  • make prepare-dev
  • make bash
  • export XDEBUG_SESSION=1[1] in the terminal before hitting 'Listen for XDebug' in VSCode (which was attached to the running container).

After it is all working and you want to invoke PHPUnit, you can either do it directly, or through composer

# these are equivalent
composer phpunit -- -c phpunit.xml.dist --bootstrap tests/bootstrap.php --filter testTranscludeAnnotationWithoutUniquidThrowsException
php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist --bootstrap tests/bootstrap.php --filter testTranscludeAnnotationWithoutUniquidThrowsException