public function process(ContainerBuilder $container)
    {
        $frameworkPath = $container->getParameter('behat.silverstripe_extension.framework_path');

        global $_FILE_TO_URL_MAPPING;
        if($container->getParameter('behat.mink.base_url')) {
            // If base_url is already defined, also set it in the SilverStripe mapping
            $_FILE_TO_URL_MAPPING[dirname($frameworkPath)] = $container->getParameter('behat.mink.base_url');
        } else if($envPath = $this->findEnvironmentConfigFile($frameworkPath)) {
            // Otherwise try to retrieve it from _ss_environment
            include_once $envPath;
            if(
                isset($_FILE_TO_URL_MAPPING) 
                && !($container->hasParameter('behat.mink.base_url') && $container->getParameter('behat.mink.base_url'))
            ) {
                $baseUrl = $this->findBaseUrlFromMapping(dirname($frameworkPath), $_FILE_TO_URL_MAPPING);
                if($baseUrl) $container->setParameter('behat.mink.base_url', $baseUrl);
            }
        }

        if(!$container->getParameter('behat.mink.base_url')) {
            throw new \InvalidArgumentException(
                '"base_url" not configured. Please specify it in your behat.yml configuration, ' .
                'or in your _ss_environment.php configuration through $_FILE_TO_URL_MAPPING'
            );
        }

        // The Behat\MinkExtension\Extension class copies configuration into an internal hash,
        // we need to follow this pattern to propagate our changes.
        $parameters = $container->getParameter('behat.mink.parameters');
        $parameters['base_url'] = $container->getParameter('behat.mink.base_url');
        $container->setParameter('behat.mink.parameters', $parameters);
    }