From: Andrew Nicols Date: Fri, 6 Jun 2014 04:09:59 +0000 (+0800) Subject: Pass through the phpunit --filter option. Fixes 84 X-Git-Tag: v1.3~21 X-Git-Url: http://git.cameron1729.xyz/?a=commitdiff_plain;h=7f40d0c573aa0a5733249f2ea2eb96338a63ed48;p=mdk.git Pass through the phpunit --filter option. Fixes 84 --- diff --git a/extra/bash_completion b/extra/bash_completion index 49312f0..9a005d8 100644 --- a/extra/bash_completion +++ b/extra/bash_completion @@ -169,7 +169,7 @@ function _mdk() { OPTS="$(compgen -A file $CUR)" compopt -o nospace else - OPTS="--force --run --testcase --unittest" + OPTS="--force --run --testcase --unittest --filter" OPTS="$OPTS $(_list_instances)" fi ;; diff --git a/lib/commands/phpunit.py b/lib/commands/phpunit.py index aaf25a8..ffd4aca 100644 --- a/lib/commands/phpunit.py +++ b/lib/commands/phpunit.py @@ -64,6 +64,14 @@ class PhpunitCommand(Command): } ), ( + ['--filter'], + { + 'default': None, + 'help': 'Filter to pass through to PHPUnit. This sets --run.', + 'metavar': 'filter' + } + ), + ( ['name'], { 'default': None, @@ -116,7 +124,7 @@ class PhpunitCommand(Command): M.initPHPUnit(force=args.force) logging.info('PHPUnit ready!') - if args.unittest or args.testcase: + if args.unittest or args.testcase or args.filter: args.run = True if args.run: @@ -129,6 +137,8 @@ class PhpunitCommand(Command): cmd.append(args.testcase) elif args.unittest: cmd.append(args.unittest) + elif args.filter: + cmd.append('--filter="%s"' % args.filter) cmd = ' '.join(cmd) process(cmd, M.get('path'), None, None) except Exception as e: