32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-26 01:57:30 +00:00

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;
//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()
->test($pathToTestFile)
->arg('--steps')

20
composer.lock generated
View File

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