Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init context parameters in SuiteHook (no need to run parent __constru…

…ct in child contexts now - fixes #104)
  • Loading branch information...
commit f33e6ceea3936aa0661d8ac031d445678989cdba 1 parent a418f7f
@everzet everzet authored
Showing with 9 additions and 20 deletions.
  1. +3 −2 behat.yml
  2. +6 −18 src/Behat/Mink/Behat/Context/MinkContext.php
View
5 behat.yml
@@ -1,5 +1,6 @@
default:
context:
parameters:
- base_url: http://test.mink.dev/
- show_cmd: open %s
+ javascript_session: selenium
+ base_url: http://test.mink.dev/
+ show_cmd: open %s
View
24 src/Behat/Mink/Behat/Context/MinkContext.php
@@ -37,19 +37,7 @@
class MinkContext extends BaseMinkContext
{
private static $mink;
- private $parameters;
-
- /**
- * Initializes Mink environment.
- *
- * @param array $parameters list of context parameters
- */
- public function __construct(array $parameters = array())
- {
- $this->parameters = static::mergeConfigWithDefaults(
- static::getDefaultParameters(), $parameters
- );
- }
+ private static $parameters;
/**
* {@inheritdoc}
@@ -70,7 +58,7 @@ public function getMink()
*/
public function getParameters()
{
- return $this->parameters;
+ return self::$parameters;
}
/**
@@ -78,11 +66,11 @@ public function getParameters()
*/
public function getParameter($name)
{
- if (!isset($this->parameters[$name])) {
+ if (!isset(self::$parameters[$name])) {
return;
}
- return $this->parameters[$name];
+ return self::$parameters[$name];
}
/**
@@ -94,7 +82,7 @@ public function getParameter($name)
*/
public static function initMinkSessions(SuiteEvent $event)
{
- $parameters = static::mergeConfigWithDefaults(
+ self::$parameters = static::mergeConfigWithDefaults(
static::getDefaultParameters(), $event->getContextParameters()
);
@@ -102,7 +90,7 @@ public static function initMinkSessions(SuiteEvent $event)
self::$mink = new Mink();
}
- static::registerMinkSessions(self::$mink, $parameters);
+ static::registerMinkSessions(self::$mink, self::$parameters);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.