-
Notifications
You must be signed in to change notification settings - Fork 41
Visual Studio Code Integration
-
Install the PHPUnit extension
-
Add the following to your
settings.json:MacOS:
"phpunit.command": "tphp debug", "phpunit.phpunit": "phpunit",
WSL: Must specify the full path to
tphp- replace/home/me/totara-docker-devwith the actual path to your docker-dev repo"phpunit.command": "/home/me/totara-docker-dev/bin/tphp debug", "phpunit.phpunit": "phpunit",
You should now be able to run PHPUnit tests by clicking on "Run test" above test methods or classes in any test file.
Note: For now, this only works with MacOS. If you find a way to get this working on WSL, please update these steps!
- Install the PHP Debug extension
- Open 'launch.json' from the Run and Debug sidebar panel
- Add the following to
configurations:So your{ "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003, "pathMappings": { "/var/www/totara/src": "${workspaceFolder}/.." } }launch.jsonlooks like this:
Now whenever you want to debug a PHP script, simply add breakpoints wherever you wish, and then ensure you start listening for the debugger within the Run and Debug sidebar.
- Install a database viewer extension such as DBCode
- Add a new connection for the database you wish
- Set the Port, User and Password values to be the same as what is listed in this table
You should now be able to view the tables for the DBMS you added.
By default, SonarQube/SonarLint allocates a lot of memory which isn't really necessary. Adding the following to your VS Code settings.json can reduce memory consumption by up to 3GB:
"sonarlint.ls.vmargs": "-Xmx512m"
Copyright (c) 2025 Totara Learning Solutions Limited