Updated the code for latest changes done in Behat
This commit is contained in:
@@ -40,20 +40,29 @@ class MinkAwareInitializer implements ContextInitializer
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if initializer supports provided context.
|
||||
* Initializes provided context.
|
||||
*
|
||||
* @param Context $context
|
||||
*/
|
||||
public function initializeContext(Context $context)
|
||||
{
|
||||
if (!$context instanceof MinkAwareContext && !$this->usesMinkDictionary($context)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$context->setMink($this->mink);
|
||||
$context->setMinkParameters($this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the context uses the MinkDictionary trait.
|
||||
*
|
||||
* @param Context $context
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
public function supportsContext(Context $context)
|
||||
private function usesMinkDictionary(Context $context)
|
||||
{
|
||||
// if context/subcontext implements MinkAwareContext
|
||||
if ($context instanceof MinkAwareContext) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// if context/subcontext uses MinkDictionary trait
|
||||
$refl = new \ReflectionObject($context);
|
||||
if (method_exists($refl, 'getTraitNames')) {
|
||||
if (in_array('Behat\\MinkExtension\\Context\\MinkDictionary', $refl->getTraitNames())) {
|
||||
@@ -63,15 +72,4 @@ class MinkAwareInitializer implements ContextInitializer
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes provided context.
|
||||
*
|
||||
* @param Context $context
|
||||
*/
|
||||
public function initializeContext(Context $context)
|
||||
{
|
||||
$context->setMink($this->mink);
|
||||
$context->setMinkParameters($this->parameters);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,10 +131,10 @@ class RawMinkContext implements MinkAwareContext
|
||||
/**
|
||||
* 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()
|
||||
* @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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user