Merge pull request #161 from javigomez/RoboUpdate2

Updating Robo Function run:test
This commit is contained in:
javier gomez 2015-11-01 16:28:05 +01:00
commit a79603b994
2 changed files with 48 additions and 11 deletions

View File

@ -171,6 +171,45 @@ class RoboFile extends \Robo\Tasks
$pathToTestFile = 'tests/' . $suite . '/' . $test; $pathToTestFile = 'tests/' . $suite . '/' . $test;
//loading the class to display the methods in the class
require 'tests/' . $suite . '/' . $test;
//logic to fetch the class name from the file name
$fileName = explode("/", $test);
$className = explode(".", $fileName[1]);
//if the selected file is cest only than we will give the option to execute individual methods, we don't need this in cept file
$i = 1;
if (strripos($className[0], 'cest'))
{
$class_methods = get_class_methods($className[0]);
$this->say('[' . $i . '] ' . 'All');
$methods[$i] = 'All';
$i++;
foreach ($class_methods as $method_name)
{
$reflect = new ReflectionMethod($className[0], $method_name);
if(!$reflect->isConstructor())
{
if ($reflect->isPublic())
{
$this->say('[' . $i . '] ' . $method_name);
$methods[$i] = $method_name;
$i++;
}
}
}
$this->say('');
$methodNumber = $this->ask('Please choose the method in the test that you would want to run...');
$method = $methods[$methodNumber];
}
if(isset($method) && $method != 'All')
{
$pathToTestFile = $pathToTestFile . ':' . $method;
}
$this->taskCodecept() $this->taskCodecept()
->test($pathToTestFile) ->test($pathToTestFile)
->arg('--steps') ->arg('--steps')

20
composer.lock generated
View File

@ -499,18 +499,16 @@
], ],
"authors": [ "authors": [
{ {
"name": "Henrik Bjornskov", "name": "Yaroslav Kiliba",
"email": "henrik@bjrnskov.dk", "email": "om.dattaya@gmail.com"
"homepage": "http://henrik.bjrnskov.dk"
}, },
{ {
"name": "Konstantin Kudryashov", "name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com", "email": "ever.zet@gmail.com"
"homepage": "http://everzet.com"
}, },
{ {
"name": "Yaroslav Kiliba", "name": "Henrik Bjrnskov",
"email": "om.dattaya@gmail.com" "email": "henrik@bjrnskov.dk"
} }
], ],
"description": "Resource Watcher.", "description": "Resource Watcher.",
@ -527,12 +525,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/joomla-projects/joomla-browser.git", "url": "https://github.com/joomla-projects/joomla-browser.git",
"reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0" "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/b0056ff0018c529cc2a143f6d78004bce8f9d5b0", "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/cdc02b3e3d7c112d83d625db7ea410dac4ce3142",
"reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0", "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -570,7 +568,7 @@
"acceptance testing", "acceptance testing",
"joomla" "joomla"
], ],
"time": "2015-10-31 11:00:18" "time": "2015-10-31 15:09:12"
}, },
{ {
"name": "joomla-projects/robo", "name": "joomla-projects/robo",