function getConfig(args) {
        var config = {
            setUp: function(){},
            tearDown: function(){}
        };

        if (utils.isFunction(args[1])) {
            config.test = args[1];
        } else if (utils.isObject(args[1])) {
            config = utils.mergeObjects(config, args[1]);
        } else if (utils.isNumber(args[1]) && utils.isFunction(args[2])) {
            config.planned = ~~args[1] || undefined;
            config.test = args[2];
        } else if (utils.isNumber(args[1]) && utils.isObject(args[2])) {
            config.config = utils.mergeObjects(config, args[2]);
            config.planned = ~~args[1] || undefined;
        } else {
            throw new CasperError('Invalid call');
        }

        if (!utils.isFunction(config.test))
            throw new CasperError('begin() is missing a mandatory test function');

        return config;
    }
Starts a suite.

Can be invoked different ways:

    casper.test.begin("suite description", plannedTests, function(test){})
    casper.test.begin("suite description", function(test){})