From dc0ea9d015c6cc24247093a2faf2bb4df9995828 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Fri, 22 Nov 2013 17:59:46 +0800 Subject: [PATCH] Command phpunit accepts a testcase as argument --- extra/bash_completion | 2 +- lib/commands/phpunit.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/extra/bash_completion b/extra/bash_completion index ebf446b..5b932b9 100644 --- a/extra/bash_completion +++ b/extra/bash_completion @@ -165,7 +165,7 @@ function _mdk() { OPTS="$(compgen -A file $CUR)" compopt -o nospace else - OPTS="--force --run --unittest" + OPTS="--force --run --testcase --unittest" OPTS="$OPTS $(_list_instances)" fi ;; diff --git a/lib/commands/phpunit.py b/lib/commands/phpunit.py index fac465e..978e57d 100644 --- a/lib/commands/phpunit.py +++ b/lib/commands/phpunit.py @@ -48,6 +48,14 @@ class PhpunitCommand(Command): } ), ( + ['-t', '--testcase'], + { + 'default': None, + 'help': 'testcase class to run. This sets --run.', + 'metavar': 'testcase' + } + ), + ( ['-u', '--unittest'], { 'default': None, @@ -101,7 +109,7 @@ class PhpunitCommand(Command): M.initPHPUnit(force=args.force) logging.info('PHPUnit ready!') - if args.unittest: + if args.unittest or args.testcase: args.run = True if args.run: @@ -110,7 +118,9 @@ class PhpunitCommand(Command): cmd.append('vendor/bin/phpunit') else: cmd.append('phpunit') - if args.unittest: + if args.testcase: + cmd.append(args.testcase) + elif args.unittest: cmd.append(args.unittest) cmd = ' '.join(cmd) process(cmd, M.get('path'), None, None) -- 2.11.0