// What to call the upstream remote, the one pointing to the official repositoriy (stable or integration)
"upstreamRemote": "origin",
+ // Behat related settings
+ "behat": {
+
+ // From 2.7 Behat requires a different wwwroot than the one set in config.php.
+ // MDK assumes that the only thing that will differ between the wwwroot and
+ // behat wwwroot is the host, nothing else. Use a ServerAlias or /etc/hosts entries.
+ "host": "127.0.0.1"
+ },
+
// The name of the data directory
"dataDir": "moodledata",
// The name of the www directory
['-d', '--disable'],
{
'action': 'store_true',
- 'help': 'disable Behat, runs the tests first if --run has been set.'
+ 'help': 'disable Behat, runs the tests first if --run has been set. Ignored from 2.7.'
}
),
(
{
'action': 'store_true',
'dest': 'switchcompletely',
- 'help': 'force the switch completely setting. This will be automatically enabled for PHP < 5.4'
+ 'help': 'force the switch completely setting. This will be automatically enabled for PHP < 5.4. Ignored from 2.7.'
}
),
(
self.disable(M)
else:
- logging.info('Launch PHP Server (or set $CFG->behat_switchcompletely to True):\n %s' % (phpCommand))
+ if M.branch_compare(27, '<'):
+ logging.info('Launch PHP Server (or set $CFG->behat_switchcompletely to True):\n %s' % (phpCommand))
if seleniumCommand:
logging.info('Launch Selenium (optional):\n %s' % (seleniumCommand))
logging.info('Launch Behat:\n %s' % (cmd))
self.updateConfig('behat_prefix', behat_prefix)
# Switch completely?
- if switchcompletely:
- self.updateConfig('behat_switchcompletely', switchcompletely)
- self.updateConfig('behat_wwwroot', self.get('wwwroot'))
+ if self.branch_compare(27, '<'):
+ if switchcompletely:
+ self.updateConfig('behat_switchcompletely', switchcompletely)
+ self.updateConfig('behat_wwwroot', self.get('wwwroot'))
+ else:
+ self.removeConfig('behat_switchcompletely')
+ self.removeConfig('behat_wwwroot')
else:
- self.removeConfig('behat_switchcompletely')
- self.removeConfig('behat_wwwroot')
+ # Defining wwwroot.
+ wwwroot = '%s://%s/' % (C.get('scheme'), C.get('behat.host'))
+ if C.get('path') != '' and C.get('path') != None:
+ wwwroot = wwwroot + C.get('path') + '/'
+ wwwroot = wwwroot + self.identifier
+ self.updateConfig('behat_wwwroot', wwwroot)
# Force a cache purge
self.purge()