esac
;;
phpunit)
- OPTS="--force --run"
- OPTS="$OPTS $($BIN info -ln)"
+ if [[ "${PREV}" == "--unittest" ]]; then
+ # Basic autocomplete for --unittest, should append a / at the end of directory names.
+ compopt +o nospace
+ OPTS="$(compgen -A file $CUR)"
+ compopt -o nospace
+ else
+ OPTS="--force --run --unittest"
+ OPTS="$OPTS $($BIN info -ln)"
+ fi
;;
purge)
OPTS="--all --integration --stable"
}
),
(
+ ['-u', '--unittest'],
+ {
+ 'default': None,
+ 'help': 'test file to run. This sets --run.',
+ 'metavar': 'path'
+ }
+ ),
+ (
['name'],
{
'default': None,
try:
M.initPHPUnit(force=args.force)
logging.info('PHPUnit ready!')
+
+ if args.unittest:
+ args.run = True
+
if args.run:
cmd = []
if M.branch_compare(25):
cmd.append('vendor/bin/phpunit')
else:
cmd.append('phpunit')
+ if args.unittest:
+ cmd.append(args.unittest)
cmd = ' '.join(cmd)
logging.info('Executing %s', cmd)
process(cmd, M.get('path'), None, None)