Giter VIP home page Giter VIP logo

vscode-phpunit's Introduction

Latest Release Installs Rating

Phpunit for VSCode

Setup

  • Install phpunit.
  • Set the config values:
{
    "phpunit.execPath": "path/to/phpunit",
    "phpunit.args": [
        "--configuration", "./phpunit.xml.dist"
    ],
    "phpunit.preferRunClassTestOverQuickPickWindow": false // Default false
}

How to use

Run with (Cmd+Shift+P on OSX or Ctrl+Shift+P on Windows and Linux) and execute the PHPUnit Test command.

  • Test a function: Place cursor on a function and run.

vscode-phpunit-test-function

  • Test a class: Place cursor on class name and run.

vscode-phpunit-test-class

  • Pick test from a list: Place cursor anywhere in class except on class name or on a function and run.

vscode-phpunit-quick-pick

  • Test everything according to --configuration: Close editor window and run.

vscode-phpunit-test-all

  • Test everything in a directory: Open a file in the directory to test and run the PHPUnit Test Directory command.

vscode-phpunit-test-directory

  • Rerun last Test: Run the PHPUnit Rerun last test command. Is also possible set a keybinding to run this command:
{ "key": "cmd+shift+r", "command": "phpunit.RerunLastTest", "when": "editorFocus" }

Notes / Tips / Advanced

  • execPath is recommended to set in your 'user settings'. Having phpunit in PATH doesn't work (at least on windows 10) =(.
  • args is recommended to set in your 'workspace settings'. You can add any phpunit args, check phpunit --help.
  • To hook into the debugger (github.com/felixfbecker/vscode-php-debug). Add Key:XDEBUG_CONFIG, Value:idekey=VSCODE to your environment variables. (Tested on Windows 10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.