You are here

public function AbstractConfig::mapRemoteFilePath in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php \Behat\Mink\Tests\Driver\AbstractConfig::mapRemoteFilePath()

Map remote file path.

Parameters

string $file File path.:

Return value

string

File

vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php, line 23

Class

AbstractConfig

Namespace

Behat\Mink\Tests\Driver

Code

public function mapRemoteFilePath($file) {
  if (!isset($_SERVER['TEST_MACHINE_BASE_PATH']) || !isset($_SERVER['DRIVER_MACHINE_BASE_PATH'])) {
    return $file;
  }
  $pattern = '/^' . preg_quote($_SERVER['TEST_MACHINE_BASE_PATH'], '/') . '/';
  $basePath = $_SERVER['DRIVER_MACHINE_BASE_PATH'];
  return preg_replace($pattern, $basePath, $file, 1);
}