Skip to content

Commit

Permalink
feat: add config flag to prefer testing class instead of quickPickWin…
Browse files Browse the repository at this point in the history
…dow.
  • Loading branch information
elonmallin committed Sep 11, 2017
1 parent 765c4fc commit 791e4e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/phpunittest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class TestRunner {
let config = vscode.workspace.getConfiguration("phpunit");
let execPath = config.get<string>("execPath", "phpunit");
let configArgs = config.get<Array<string>>("args", []);
let preferRunClassTestOverQuickPickWindow = config.get<Boolean>("preferRunClassTestOverQuickPickWindow", false);

let args = [].concat(configArgs);

Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 791e4e3

Please sign in to comment.