All Projects → recca0120 → vscode-phpunit

recca0120 / vscode-phpunit

Licence: MIT license
The VS Code Test Explorer extension for PHPUnit

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to vscode-phpunit

phpunit-injector
Injects services from a PSR-11 dependency injection container to PHPUnit test cases
Stars: ✭ 62 (-38%)
Mutual labels:  test, phpunit
TFM
Tyler's Frame Machine is a simple, free, educational, and portable tool for testing, benchmarking, comparison, and demonstration. TFM supports OpenGL, DirectX 11, DirectX 12, Metal, and most importantly, Vulkan! https://tylemagne.github.io/TFM
Stars: ✭ 63 (-37%)
Mutual labels:  test
slim-skeleton
Slim Framework skeleton application following MVC construction
Stars: ✭ 18 (-82%)
Mutual labels:  phpunit
specter-php
JSON Mocking and Testing for PHP
Stars: ✭ 18 (-82%)
Mutual labels:  phpunit
Starwars-clean
Simple project with clean architecture
Stars: ✭ 34 (-66%)
Mutual labels:  test
phpunit-detailed-printer
Detailed output formatter for PHPUnit tests
Stars: ✭ 39 (-61%)
Mutual labels:  phpunit
PhpUnitAssertException
Assert exception/throwable/error PHPUnit trait
Stars: ✭ 18 (-82%)
Mutual labels:  phpunit
lwc-test
LWC plugins and utilities for testing
Stars: ✭ 39 (-61%)
Mutual labels:  test
pytest
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
Stars: ✭ 9,731 (+9631%)
Mutual labels:  test
m.test
m(icro)test is a lightweight test runner for node.js written in es6+
Stars: ✭ 17 (-83%)
Mutual labels:  test
7182
Curso 7182 - Refatorando para testes de unidade
Stars: ✭ 21 (-79%)
Mutual labels:  test
api-with-express
🌈 API with Express
Stars: ✭ 25 (-75%)
Mutual labels:  test
wire-service-jest-util
Utility library for @-wire Lightning Web Component tests
Stars: ✭ 18 (-82%)
Mutual labels:  test
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕
Stars: ✭ 409 (+309%)
Mutual labels:  test
mock-hls-server
Fake a live/event HLS stream from a VOD one. Useful for testing. Supports looping.
Stars: ✭ 61 (-39%)
Mutual labels:  test
phpboilerplate
PHP boilerplate with composer psr-4, phpunit and travis-ci.
Stars: ✭ 15 (-85%)
Mutual labels:  phpunit
intellij-drupal-run-tests
Provides a run configuration that executes Drupal's test runner (for Simpletest, Unit, Kernel, Functional, FunctionalJavascript.)
Stars: ✭ 24 (-76%)
Mutual labels:  phpunit
SwiftParamTest
Parameterized test for Swift
Stars: ✭ 56 (-44%)
Mutual labels:  test
elastic-search-test
ESIntegTestCase example
Stars: ✭ 17 (-83%)
Mutual labels:  test
sfdx-lwc-jest
Run Jest against LWC components in SFDX workspace environment
Stars: ✭ 136 (+36%)
Mutual labels:  test

PHPUnit for VSCode

Run your PHPUnit tests in Node using the Test Explorer UI.

Screenshot

Features

  • Shows a Test Explorer in the Test view in VS Code's sidebar with all detected tests and suites and their state
  • Shows a failed test's log when the test is selected in the explorer
  • Lets you choose test suites or individual tests in the explorer that should be run automatically after each file change

Extension Settings

Include if your extension adds any VS Code settings through the contributes.configuration extension point.

This extension contributes the following settings:

  • phpunit.php: Absolute path to php. Fallback to global php if it exists on the command line.
  • phpunit.phpunit: Path to phpunit. Can be the phpunit file or phpunit.phar.\n\nAutomatically finds it in common places:\n - Composer vendor directory\n - phpunit.phar in your project\n - phpunit (or phpunit.bat for windows) globally on the command line
  • phpunit.command: Custom command to run. Ex: docker exec -t container_name.
  • phpunit.args: Any phpunit args (phpunit --help) E.g. --configuration ./phpunit.xml.dist
  • phpunit.clearOutputOnRun: True will clear the output when we run a new test. False will leave the output after every test.
  • phpunit.showAfterExecution Specify if the test report will automatically be shown after execution

Commands

The following commands are available in VS Code's command palette, use the ID to add them to your keyboard shortcuts:

  • phpunit.reload: PHPUnit: Reload tests
  • phpunit.run-all: PHPUnit: Run all tests
  • phpunit.run-file: PHPUnit: Run tests in current file
  • phpunit.run-test-at-cursor: PHPUnit: Run the test at the current cursor position
  • phpunit.rerun: PHPUnit: Repeat the last test run

Configuration

ParaTest

{
  "phpunit.php": "php",
  "phpunit.phpunit": "vendor/bin/paratest",
  "phpunit.args": [
    "-c",
    "phpunit.xml"
  ],
  "phpunit.paths": {
    // ${pwd} (current directory) is mounted to /app
    "${workspaceFolder}": '/app',
    // ${workspaceFolder} is mapped to /app
  },
}

Docker

{
  "phpunit.command": 'docker run --rm -t -v ${pwd}:/app -w /app php:latest php',
  "phpunit.php": "php",
  "phpunit.phpunit": "vendor/bin/phpunit",
  "phpunit.args": [
    "-c",
    "phpunit.xml"
  ],
  "phpunit.paths": {
    // ${pwd} (current directory) is mounted to /app
    "${workspaceFolder}": '/app',
    // ${workspaceFolder} is mapped to /app
  },
}

SSH

{
  "phpunit.command": "ssh -i dockerfiles/sshd/id_rsa -p 2222 root@localhost -o StrictHostKeyChecking=no",
  "phpunit.php": "php",
  "phpunit.phpunit": "/app/vendor/bin/phpunit",
  "phpunit.args": [
    "-c",
    "/app/phpunit.xml"
  ],
  "phpunit.paths": {
    // ${pwd} (current directory) is mounted to /app
    "${workspaceFolder}": '/app',
    // ${workspaceFolder} is mapped to /app
  }
}

Troubleshooting

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].