Permalink
Browse files

Move generic functions to RawMinkContext [2/2]

  • Loading branch information...
1 parent 7968dbc commit 0f92203531851a014f7e5bac89b6bfbb42519594 @everzet everzet committed Oct 24, 2012
Showing with 0 additions and 32 deletions.
  1. +0 −32 src/Behat/MinkExtension/Context/MinkContext.php
@@ -447,21 +447,6 @@ public function getMinkTranslationResources()
}
/**
- * Locates url, based on provided path.
- * Override to provide custom routing mechanism.
- *
- * @param string $path
- *
- * @return string
- */
- protected function locatePath($path)
- {
- $startUrl = rtrim($this->getMinkParameter('base_url'), '/') . '/';
-
- return 0 !== strpos($path, 'http') ? $startUrl . ltrim($path, '/') : $path;
- }
-
- /**
* Returns fixed step argument (with \\" replaced back to ").
*
* @param string $argument
@@ -472,21 +457,4 @@ protected function fixStepArgument($argument)
{
return str_replace('\\"', '"', $argument);
}
-
- /**
- * Save a screenshot of the current window to the file system.
- *
- * @param string $filename Desired filename, defaults to
- * <browser_name>_<ISO 8601 date>_<randomId>.png
- * @param string $filepath Desired filepath, defaults to
- * upload_tmp_dir, falls back to sys_get_temp_dir()
- */
- public function saveScreenshot($filename = null, $filepath = null)
- {
- // Under Cygwin, uniqid with more_entropy must be set to true.
- // No effect in other environments.
- $filename = $filename ?: sprintf('%s_%s_%s.%s', $this->getMinkParameter('browser_name'), date('c'), uniqid('', true), 'png');
- $filepath = $filepath ? $filepath : ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();
- file_put_contents($filepath . '/' . $filename, $this->getSession()->getScreenshot());
- }
}

0 comments on commit 0f92203

Please sign in to comment.