From c3fca8fcb0b7b3fd4c994fb747e3e7d67e05d51e Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Fri, 13 Dec 2013 08:00:46 +0100 Subject: [PATCH] Throw error when using testcase with <= 2.5 --- lib/commands/phpunit.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/commands/phpunit.py b/lib/commands/phpunit.py index 978e57d..7da728d 100644 --- a/lib/commands/phpunit.py +++ b/lib/commands/phpunit.py @@ -51,7 +51,7 @@ class PhpunitCommand(Command): ['-t', '--testcase'], { 'default': None, - 'help': 'testcase class to run. This sets --run.', + 'help': 'testcase class to run. This sets --run. (From Moodle 2.6)', 'metavar': 'testcase' } ), @@ -86,6 +86,10 @@ class PhpunitCommand(Command): if not M.get('installed'): raise Exception('This instance needs to be installed first') + # Check if testcase option is available. + if args.testcase and M.branch_compare('26', '<'): + self.argumentError('The --testcase option only works with Moodle 2.6 or greater.') + # Install Composer for >= 2.5 if M.branch_compare(25): if not os.path.isfile(os.path.join(M.get('path'), 'composer.phar')): -- 2.11.0