Refactored the extension for Behat 3.0
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Behat MinkExtension.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Behat\MinkExtension\Context\ClassGuesser;
|
||||
|
||||
use Behat\Behat\Context\ClassGuesser\ClassGuesserInterface;
|
||||
|
||||
/**
|
||||
* Mink context class guesser.
|
||||
* Provides Mink context class if no other class found.
|
||||
*/
|
||||
class MinkContextClassGuesser implements ClassGuesserInterface
|
||||
{
|
||||
/**
|
||||
* Tries to guess context classname.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function guess()
|
||||
{
|
||||
return 'Behat\\MinkExtension\\Context\\MinkContext';
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ use Behat\Behat\Context\Context;
|
||||
use Behat\Behat\Context\Initializer\ContextInitializer;
|
||||
|
||||
use Behat\Mink\Mink;
|
||||
use Behat\MinkExtension\Context\MinkAwareInterface;
|
||||
use Behat\MinkExtension\Context\MinkAwareContext;
|
||||
|
||||
/**
|
||||
* Mink aware contexts initializer.
|
||||
@@ -48,8 +48,8 @@ class MinkAwareInitializer implements ContextInitializer
|
||||
*/
|
||||
public function supportsContext(Context $context)
|
||||
{
|
||||
// if context/subcontext implements MinkAwareInterface
|
||||
if ($context instanceof MinkAwareInterface) {
|
||||
// if context/subcontext implements MinkAwareContext
|
||||
if ($context instanceof MinkAwareContext) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
namespace Behat\MinkExtension\Context;
|
||||
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Mink\Mink;
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,7 @@ use Behat\Mink\Mink;
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*/
|
||||
interface MinkAwareInterface
|
||||
interface MinkAwareContext extends Context
|
||||
{
|
||||
/**
|
||||
* Sets Mink instance.
|
||||
@@ -10,8 +10,6 @@
|
||||
|
||||
namespace Behat\MinkExtension\Context;
|
||||
|
||||
use Behat\Behat\Context\Context;
|
||||
|
||||
use Behat\Mink\Mink;
|
||||
use Behat\Mink\WebAssert;
|
||||
use Behat\Mink\Session;
|
||||
@@ -22,7 +20,7 @@ use Behat\Mink\Session;
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*/
|
||||
class RawMinkContext implements MinkAwareInterface, Context
|
||||
class RawMinkContext implements MinkAwareContext
|
||||
{
|
||||
private $mink;
|
||||
private $minkParameters;
|
||||
|
||||
Reference in New Issue
Block a user