protected function execute($contextapi, $params = array()) {
        if (!is_array($params)) {
            $params = array($params);
        }

        // Get required context and execute the api.
        $contextapi = explode("::", $contextapi);
        $context = behat_context_helper::get($contextapi[0]);
        call_user_func_array(array($context, $contextapi[1]), $params);

        // NOTE: Wait for pending js and look for exception are not optional, as this might lead to unexpected results.
        // Don't make them optional for performance reasons.

        // Wait for pending js.
        $this->wait_for_pending_js();

        // Look for exceptions.
        $this->look_for_exceptions();
    }
protected function execute($contextapi, $params = array()) {
        if (!is_array($params)) {
            $params = array($params);
        }

        // Get required context and execute the api.
        $contextapi = explode("::", $contextapi);
        $context = behat_context_helper::get($contextapi[0]);
        call_user_func_array(array($context, $contextapi[1]), $params);

        // NOTE: Wait for pending js and look for exception are not optional, as this might lead to unexpected results.
        // Don't make them optional for performance reasons.

        // Wait for pending js.
        $this->wait_for_pending_js();

        // Look for exceptions.
        $this->look_for_exceptions();
    }
protected function execute ( $ contextapi , $ params = array ( ) ) { if ( ! is_array ( $ params ) ) { $ params = array ( $ params ) ; } // Get required context and execute the api. $ contextapi = explode ( "::" , $ contextapi ) ; $ context = behat_context_helper :: get ( $ contextapi [ 0 ] ) ; call_user_func_array ( array ( $ context , $ contextapi [ 1 ] ) , $ params ) ; // NOTE: Wait for pending js and look for exception are not optional, as this might lead to unexpected results. // Don't make them optional for performance reasons. // Wait for pending js. $ this -> wait_for_pending_js ( ) ; // Look for exceptions. $ this -> look_for_exceptions ( ) ; }
Helper function to execute api in a given context.

@param string $contextapi context in which api is defined.
@param array $params list of params to pass.
@throws Exception
Helper function to execute api in a given context .