src/Behat/Behat/Context/Environment/UninitializedContextEnvironment.php
public function registerContextClass($contextClass, array $arguments = null)
    {
        if (!class_exists($contextClass)) {
            throw new ContextNotFoundException(sprintf(
                '`%s` context class not found and can not be used.',
                $contextClass
            ), $contextClass);
        }

        $reflClass = new \ReflectionClass($contextClass);

        if (!$reflClass->implementsInterface('Behat\Behat\Context\Context')) {
            throw new WrongContextClassException(sprintf(
                'Every context class must implement Behat Context interface, but `%s` does not.',
                $contextClass
            ), $contextClass);
        }

        $this->contextClasses[$contextClass] = $arguments ? : array();
    }
public function registerContextClass($contextClass, array $arguments = null)
    {
        if (!class_exists($contextClass)) {
            throw new ContextNotFoundException(sprintf(
                '`%s` context class not found and can not be used.',
                $contextClass
            ), $contextClass);
        }

        $reflClass = new \ReflectionClass($contextClass);

        if (!$reflClass->implementsInterface('Behat\Behat\Context\Context')) {
            throw new WrongContextClassException(sprintf(
                'Every context class must implement Behat Context interface, but `%s` does not.',
                $contextClass
            ), $contextClass);
        }

        $this->contextClasses[$contextClass] = $arguments ? : array();
    }
public function registerContextClass ( $ contextClass , array $ arguments = null ) { if ( ! class_exists ( $ contextClass ) ) { throw new ContextNotFoundException ( sprintf ( '`%s` context class not found and can not be used.' , $ contextClass ) , $ contextClass ) ; } $ reflClass = new \ ReflectionClass ( $ contextClass ) ; if ( ! $ reflClass -> implementsInterface ( 'Behat\Behat\Context\Context' ) ) { throw new WrongContextClassException ( sprintf ( 'Every context class must implement Behat Context interface, but `%s` does not.' , $ contextClass ) , $ contextClass ) ; } $ this -> contextClasses [ $ contextClass ] = $ arguments ? : array ( ) ; }
Registers context class.

@param string     $contextClass
@param null|array $arguments

@throws ContextNotFoundException   If class does not exist
@throws WrongContextClassException if class does not implement Context interface
Registers context class .