Skip to content

Commit

Permalink
fix: #471 Goto and rerun tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Nybroe committed Sep 12, 2023
1 parent 2b23e9f commit 22e6546
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.pestphp.pest.runner.LocationInfo
/**
* Adds support for goto test from test results.
*/
class PestLocationProvider(private val pathMapper: PhpPathMapper) : SMTestLocator {
class PestLocationProvider(private val pathMapper: PhpPathMapper, private val project: Project) : SMTestLocator {
private val protocolId = "pest_qn"
private val phpUnitLocationProvider = PhpUnitQualifiedNameLocationProvider.create(pathMapper)

Expand Down Expand Up @@ -52,7 +52,7 @@ class PestLocationProvider(private val pathMapper: PhpPathMapper) : SMTestLocato
val location = link.split("::")


val file = this.pathMapper.getLocalFile(location[0])
val file = this.pathMapper.getLocalFile("${this.project.basePath}/${location[0]}")

if (location.size == 1) {
return file?.let { LocationInfo(it, null) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.jetbrains.php.PhpBundle
import com.jetbrains.php.config.commandLine.PhpCommandLinePathProcessor
import com.jetbrains.php.config.commandLine.PhpCommandSettings
import com.jetbrains.php.config.interpreters.PhpInterpreter
import com.jetbrains.php.phpunit.PhpUnitQualifiedNameLocationProvider
import com.jetbrains.php.run.PhpRunUtil
import com.jetbrains.php.run.remote.PhpRemoteInterpreterManager
import com.jetbrains.php.testFramework.PhpTestFrameworkConfiguration
Expand Down Expand Up @@ -110,7 +109,7 @@ class PestRunConfiguration(project: Project, factory: ConfigurationFactory) : Ph
return PestConsoleProperties(
this,
executor,
PestLocationProvider(pathMapper)
PestLocationProvider(pathMapper, this.project)
)
}

Expand Down

0 comments on commit 22e6546

Please sign in to comment.