Skip to content

Commit 31b8d3f

Browse files
committed
Run configuration: more helpful error message when the project PHP interpreter is not set
1 parent ed76262 commit 31b8d3f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

resources/messages/TesterBundle.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ configurationType.description=Run tests via Nette Tester
2424
configurationType.method.displayName=Nette Tester test method
2525
configurationType.method.description=Run a single Nette Tester TestCase test method
2626

27-
runConfiguration.errors.phpExecutableNotFound=PHP executable not found.
27+
runConfiguration.errors.phpInterpreterNotSet=PHP interpreter for current project is not set or was not be found.
28+
runConfiguration.errors.phpExecutableNotFound=PHP executable of the project PHP interpreter was not found.
2829
runConfiguration.errors.noTestScope=You must specify the test scope.
2930
runConfiguration.errors.testScopeNotFound=File or directory set as the test scope was not found.
30-
runConfiguration.errors.testEnvInterpreterNotFound=Test environment PHP interpreter not found.
31-
runConfiguration.errors.testEnvExecutableNotFound=Test environment PHP executable not found.
32-
runConfiguration.errors.noExecutable=You must specify path to Tester executable.
31+
runConfiguration.errors.testEnvInterpreterNotFound=Test environment PHP interpreter was not found.
32+
runConfiguration.errors.testEnvExecutableNotFound=Test environment PHP executable was not found.
33+
runConfiguration.errors.noExecutable=You must specify the path to Tester executable.
3334
runConfiguration.errors.executableNotFound=Tester executable was not found at given path.
3435
runConfiguration.errors.phpIniNotFound=The php.ini file was not found at given path.
3536
runConfiguration.errors.setupScriptNotFound=The setup script file was not found at given path.

src/cz/jiripudil/intellij/nette/tester/configuration/TesterRunConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
5656
public void checkConfiguration() throws RuntimeConfigurationException {
5757
PhpInterpreter interpreter = PhpProjectConfigurationFacade.getInstance(getProject()).getInterpreter();
5858
if (interpreter == null) {
59-
throw new RuntimeConfigurationError(PhpCommandSettingsBuilder.INTERPRETER_NOT_FOUND_ERROR);
59+
throw new RuntimeConfigurationError(TesterBundle.message("runConfiguration.errors.phpInterpreterNotSet"));
6060

6161
} else if (interpreter.getPathToPhpExecutable() == null) {
6262
throw new RuntimeConfigurationError(TesterBundle.message("runConfiguration.errors.phpExecutableNotFound"));
@@ -140,7 +140,7 @@ public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunne
140140
private PhpCommandSettings createCommand(Map<String, String> envParameters, List<String> arguments, boolean withDebuggerOptions) throws ExecutionException {
141141
PhpInterpreter interpreter = PhpProjectConfigurationFacade.getInstance(getProject()).getInterpreter();
142142
if (interpreter == null) {
143-
throw new ExecutionException(PhpCommandSettingsBuilder.INTERPRETER_NOT_FOUND_ERROR);
143+
throw new ExecutionException(TesterBundle.message("runConfiguration.errors.phpInterpreterNotSet"));
144144

145145
} else {
146146
PhpCommandSettings command = PhpCommandSettingsBuilder.create(getProject(), interpreter, withDebuggerOptions);

0 commit comments

Comments
 (0)