• Stars
    star
    211
  • Rank 186,867 (Top 4 %)
  • Language
    TypeScript
  • Created about 7 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A better PHPUnit test runner for VS Code

Better PHPUnit

Better PHPUnit is the most popular, cleanest, and fastest PHPUnit runner for VS Code.

Demo GIF

Run a test method:

  • Place your cursor in/on the method you want to run
  • Open the command menu: cmd+shift+p
  • Select: Better PHPUnit: run

Run a test file:

  • Open the command menu: cmd+shift+p
  • Select: Better PHPUnit: run-file

Run the entire suite:

  • Open the command menu: cmd+shift+p
  • Select: Better PHPUnit: run suite

Run the previous test:

  • Open the command menu: cmd+shift+p
  • Select: Better PHPUnit: run previous

Features:

  • Color output!
  • Run individual methods by placing your cursor anywhere in/on the method
  • Test failures are displayed in the "Problems" panel for quick access

Note: this plugin registers "tasks" to run phpunit, not a command like other extensions. This makes it possible to leverage the problem output and color terminal.

Keybindings:

{
    "key": "cmd+k cmd+r",
    "command": "better-phpunit.run"
},
{
    "key": "cmd+k cmd+f",
    "command": "better-phpunit.run-file"
},
{
    "key": "cmd+k cmd+p",
    "command": "better-phpunit.run-previous"
}

Config:

{
    "better-phpunit.commandSuffix": null, // This string will be appended to the phpunit command, it's a great place to add flags like '--stop-on-failure'
    "better-phpunit.phpunitBinary": null // A custom phpunit binary. Ex: 'phpunit', '/usr/local/bin/phpunit'
    "better-phpunit.suiteSuffix": null // Specify options to appended only to the 'run suite' command, for example add options like '--testsuite unit' or '--coverage --coverage-xml'.
}

Running tests over ssh (For VMs like Laravel Homestead):

{
    "better-phpunit.ssh.enable": true,
    "better-phpunit.ssh.paths": {
        "/your/local/path": "/your/remote/path"
    },
    "better-phpunit.ssh.user": "user",
    "better-phpunit.ssh.host": "host",
    "better-phpunit.ssh.port": "22"
    "better-phpunit.ssh.binary": "putty -ssh"
}

Running tests in already running Docker containers:

{
    "better-phpunit.docker.enable": true,
    "better-phpunit.docker.command": "docker exec container-name",
    "better-phpunit.docker.paths": {
        "/your/local/path": "/your/remote/path"
    },
}

Running tests with Docker Compose, starting up a service and removing the container when finished:

{
    "better-phpunit.docker.enable": true,
    "better-phpunit.docker.command": "docker-compose run --rm service-name",
    "better-phpunit.docker.paths": {
        "/your/local/path": "/your/remote/path"
    },
}

Note: For running Docker over a SSH session just use both options ssh.enable and docker.enable combined.

Wish List:

  • Handling PHP fatal and parser errors
  • A sidebar panel for managing errors
  • Re-run failures

More Repositories

1

sushi

Eloquent's missing "array" driver.
PHP
2,570
star
2

awesome-helpers

Helper functions I find super-duper handy
PHP
629
star
3

onboard

A Laravel package to help track user onboarding steps.
PHP
439
star
4

gitdown

A simple package to parse Github Flavored Markdown in PHP
PHP
219
star
5

laracasts-livewire-datatable

The Laravel project I used during the "Building DataTables with Livewire" Laracasts video
PHP
118
star
6

bear-sync

Access your Bear notes in Laravel
PHP
107
star
7

tailbuild

A simple command to build a Tailwind CSS file for your project (with JIT compiling and watching)
JavaScript
89
star
8

laravel-helpers-file

Because I can never remember exactly how to autoload my helpers.php file.
PHP
61
star
9

laravel-frontend-preset

My personal frontend preset for new laravel applications.
PHP
31
star
10

laracon-online-2020

The Laravel project used in my Laracon Online 2020 talk
PHP
28
star
11

laracasts-building-alpine

JavaScript
27
star
12

simple-php-cs-fixer

A VS Code extension for simple php-cs-fixer integration
PHP
24
star
13

sps

TypeScript
20
star
14

vue-form-state

JavaScript
19
star
15

vercel-laravel

PHP
19
star
16

click

The podcast recording and editing suite of your dreams. Featuring just the one button.
Crystal
18
star
17

livewire-uncovered

PHP
13
star
18

laracasts-turbolinks

The source app from my Laracasts turbolinks video.
PHP
11
star
19

usesushi.dev

The website for sushi
PHP
10
star
20

presettings

A VS Code extension for storing and activating settings presets
TypeScript
10
star
21

laracasts-server-fetched-partials

The Laravel app used in my Laracasts episode on "Server-Fetched Partials"
PHP
10
star
22

laracasts-cached-server-fetched-partials

The finished Laravel app from my "Caching Server Fetched Partials" video.
PHP
10
star
23

vue-fetch-html

A little component for fetching html/vue/javascript from the server.
Vue
9
star
24

livewire-bot

Livewire's GitHub bot
PHP
7
star
25

laravel-acceptance-example

An example laravel project with acceptance tests that render javascript and work well with laravel's helpers.
PHP
7
star
26

model-inheritance

PHP
6
star
27

99bottles-php

PHP
4
star
28

edoc-2019

PHP
4
star
29

vue-example-component

For when you regret getting rid of the default Laravel ExampleComponent.vue
Vue
3
star
30

screendit

PHP
3
star
31

calebporzio

3
star
32

johnny

HTML
2
star
33

dotfiles

Shell
2
star
34

write-less-js

PHP
1
star
35

advent-of-code-2018

My Advent Of Code solutions for 2018
PHP
1
star
36

rm-me

1
star
37

spend-mo

JavaScript
1
star
38

psrpoetry

HTML
1
star
39

ingenuity

CSS
1
star
40

ingenuity-teaser

HTML
1
star
41

theretireddevtheme

A modified ghost (blog) theme for theretireddev.com
CSS
1
star