gerardroche / sublime-phpunit

PHPUnit Sublime Text integration.
https://www.gerardroche.com
GNU General Public License v3.0
74 stars 11 forks source link

Auto-run tests on save #83

Closed xieguo closed 4 years ago

xieguo commented 5 years ago

System: Windows10 Sublime version: 3.3.1,Build 3176 PHP version: 7.2.1 PhpUnit version: 7.1.5

There's a setting called 'run_on_save' set to 'true',But not automatically run the tests for the current file whenever it is saved.

gerardroche commented 5 years ago

The setting is:

    // Enable writing out every buffer (in the active window) with changes
    // before running tests.
    "phpunit.save_all_on_run": true

This is a flag to enable saving all files before running tests.

Auto running tests on save would be a new feature.

xieguo commented 5 years ago

The setting is:

    // Enable writing out every buffer (in the active window) with changes
    // before running tests.
    "phpunit.save_all_on_run": true

This is a flag to enable saving all files before running tests.

Auto running tests on save would be a new feature.

Thank you

mcclone2001 commented 5 years ago

Hey this would improve our productivity. We should pay attention only when an error occurs, so i would like to suggest opening the output only when an error occurs

gerardroche commented 1 year ago

You can enable auto run as follows:

Autocommands

You can configure the on_post_save event to run the "Test File" command when views are saved. This will instruct the runner to automatically run a test every time it is saved.

Menu → Preferences → Settings

"phpunit.on_post_save": [
    "phpunit_test_file"
]