From 791e4e3cff65b296070eb2bc77dfcae04d8834fc Mon Sep 17 00:00:00 2001 From: Elon Mallin Date: Mon, 11 Sep 2017 19:08:07 +0200 Subject: [PATCH] feat: add config flag to prefer testing class instead of quickPickWindow. --- package.json | 5 +++++ src/phpunittest.ts | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/package.json b/package.json index 28e919e..8b13ed5 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,11 @@ "type": "array", "default": [], "description": "Any phpunit args (phpunit --help)" + }, + "phpunit.preferRunClassTestOverQuickPickWindow": { + "type": "Boolean", + "default": false, + "description": "If we should test the whole class instead of showing the quick pick window when cursor is on anything but a function name." } } } diff --git a/src/phpunittest.ts b/src/phpunittest.ts index e8c9299..23bb12e 100644 --- a/src/phpunittest.ts +++ b/src/phpunittest.ts @@ -35,6 +35,7 @@ export class TestRunner { let config = vscode.workspace.getConfiguration("phpunit"); let execPath = config.get("execPath", "phpunit"); let configArgs = config.get>("args", []); + let preferRunClassTestOverQuickPickWindow = config.get("preferRunClassTestOverQuickPickWindow", false); let args = [].concat(configArgs); @@ -79,6 +80,13 @@ export class TestRunner { } } + if (preferRunClassTestOverQuickPickWindow) + { + // Run test on class instantly. + this.execPhpUnit(execPath, args); + return; + } + var promise = this.getUserSelectedTest(editor); if (promise) {