Skip to content

Commit

Permalink
fix(coverage): Fix selected engine not saved (#439)
Browse files Browse the repository at this point in the history
Co-authored-by: Edie Lemoine <[email protected]>
  • Loading branch information
olivernybroe and EdieLemoine authored Mar 1, 2023
1 parent c006b16 commit 80472f1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# PEST IntelliJ Changelog

## Unreleased
### Fixed
- Fixed "Preferred Coverage Engine" not being saved

## 1.9.1 - 2023-02-28

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pluginGroup = com.pestphp
pluginName = PEST PHP
pluginVersion = 1.9.1
pluginVersion = 1.9.2

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PestRunConfiguration(project: Project, factory: ConfigurationFactory) : Ph
val editor = this.getConfigurationEditor(names)

editor.setRunnerOptionsDocumentation("https://pestphp.com/docs/installation")
return PestTestRunConfigurationEditor(editor, project, this)
return PestTestRunConfigurationEditor(editor, this)
}

@Throws(ExecutionException::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.intellij.openapi.options.SettingsEditor
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.ComboBox
import com.intellij.util.ui.UI
import com.jetbrains.php.config.interpreters.PhpInterpretersManagerImpl
import com.jetbrains.php.phpunit.coverage.PhpUnitCoverageEngine.CoverageEngine
import com.jetbrains.php.testFramework.run.PhpTestRunConfigurationEditor
import java.awt.BorderLayout
Expand All @@ -15,7 +14,6 @@ import javax.swing.JPanel

class PestTestRunConfigurationEditor(
private val parentEditor: PhpTestRunConfigurationEditor,
project: Project,
settings: PestRunConfiguration
) : SettingsEditor<PestRunConfiguration>() {
private val myMainPanel = JPanel()
Expand All @@ -30,21 +28,9 @@ class PestTestRunConfigurationEditor(
myMainPanel.layout = BorderLayout()
myMainPanel.add(parentEditor.component, BorderLayout.CENTER)
myMainPanel.add(coveragePanel, BorderLayout.SOUTH)
coverageEngineComboBox.addItemListener { this.validateEngine(project) }
resetEditorFrom(settings)
}

private fun validateEngine(project: Project) {
val item = coverageEngineComboBox.selectedItem as CoverageEngine

val interpreter = PhpInterpretersManagerImpl
.getInstance(project)
.findInterpreter(item.name) ?: return

CoverageEngine.validateCoverageEngine(interpreter, project, item)
TODO("Show error message when validation fails.")
}

override fun createEditor(): JComponent {
return myMainPanel
}
Expand Down

0 comments on commit 80472f1

Please sign in to comment.