32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2025-03-19 13:42:22 +00:00

Merge pull request #151 from therunnergit/extension-refactoring

Refactor method to get extension
This commit is contained in:
Viktor Vogel 2015-11-01 15:53:06 +01:00
commit d902a88504

View File

@ -15,10 +15,25 @@ class RoboFile extends \Robo\Tasks
// Load tasks from composer, see composer.json // Load tasks from composer, see composer.json
use \joomla_projects\robo\loadTasks; use \joomla_projects\robo\loadTasks;
private $extension = ''; /**
* File extension for executables
*
* @var string
*/
private $executableExtension = '';
/**
* Local configuration parameters
*
* @var array
*/
private $configuration = array(); private $configuration = array();
/**
* Path to the local CMS root
*
* @var string
*/
private $cmsPath = ''; private $cmsPath = '';
/** /**
@ -30,30 +45,31 @@ class RoboFile extends \Robo\Tasks
$this->cmsPath = $this->getCmsPath(); $this->cmsPath = $this->getCmsPath();
// TODO make this coherent with the above initializations $this->executableExtension = $this->getExecutableExtension();
$this->setExecExtension();
} }
/** /**
* Set the Execute extension for Windows Operating System * Get the executable extension according to Operating System
* *
* @return void * @return void
*/ */
private function setExecExtension() private function getExecutableExtension()
{ {
if ($this->isWindows()) if ($this->isWindows())
{ {
$this->extension = '.exe'; return '.exe';
} }
return '';
} }
/** /**
* Executes all the Selenium System Tests in a suite on your machine * Executes all the Selenium System Tests in a suite on your machine
* *
* @param bool $use_htaccess Renames and enable embedded Joomla .htaccess file * @param bool $use_htaccess Renames and enable embedded Joomla .htaccess file
* *
* @return mixed * @return mixed
*/ */
public function runTests($use_htaccess = false) public function runTests($use_htaccess = false)
{ {
$this->createTestingSite($use_htaccess); $this->createTestingSite($use_htaccess);
@ -156,11 +172,11 @@ class RoboFile extends \Robo\Tasks
$pathToTestFile = 'tests/' . $suite . '/' . $test; $pathToTestFile = 'tests/' . $suite . '/' . $test;
$this->taskCodecept() $this->taskCodecept()
->test($pathToTestFile) ->test($pathToTestFile)
->arg('--steps') ->arg('--steps')
->arg('--debug') ->arg('--debug')
->run() ->run()
->stopOnFail(); ->stopOnFail();
} }
/** /**
@ -280,7 +296,7 @@ class RoboFile extends \Robo\Tasks
{ {
$branch = empty($this->configuration->branch) ? 'staging' : $this->configuration->branch; $branch = empty($this->configuration->branch) ? 'staging' : $this->configuration->branch;
return "git" . $this->extension . " clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache"; return "git" . $this->executableExtension . " clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache";
} }
/** /**