From 0168e74bbaa90b6e1738b33451e47d756643ebf6 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 27 Aug 2016 17:22:04 +0200 Subject: [PATCH 1/2] robo --- RoboFile.php | 54 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 79dc5da32a..f35471a1c6 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -1,15 +1,18 @@ configuration = $this->getConfiguration(); - - $this->cmsPath = $this->getTestingPath(); + $this->cmsPath = $this->getTestingPath(); // Set default timezone (so no warnings are generated if it is not set) date_default_timezone_set('UTC'); @@ -73,9 +77,9 @@ public function __construct() /** * Get (optional) configuration from an external file * - * @since __DEPLOY_VERSION__ + * @since __DEPLOY_VERSION__ * - * @return \stdClass|null + * @return \stdClass|null */ public function getConfiguration() { @@ -103,9 +107,9 @@ public function getConfiguration() /** * Get the correct CMS root path * - * @since __DEPLOY_VERSION__ + * @since __DEPLOY_VERSION__ * - * @return string + * @return string */ private function getTestingPath() { @@ -116,7 +120,7 @@ private function getTestingPath() if (!file_exists(dirname($this->configuration->cmsPath))) { - $this->say("Cms path written in local configuration does not exists or is not readable"); + $this->say("CMS path written in local configuration does not exists or is not readable"); return $this->testsPath . 'joomla-cms3'; } @@ -129,7 +133,7 @@ private function getTestingPath() * * @since __DEPLOY_VERSION__ * - * @return bool + * @return bool This is allways true */ public function build() { @@ -139,13 +143,13 @@ public function build() /** * Creates a testing Joomla site for running the tests (use it before run:test) * - * @param bool $use_htaccess (1/0) Rename and enable embedded Joomla .htaccess file + * @param bool $useHtaccess (1/0) Rename and enable embedded Joomla .htaccess file * * @since __DEPLOY_VERSION__ * * @return void */ - public function createTestingSite($use_htaccess = false) + public function createTestingSite($useHtaccess = false) { // Clean old testing site if (is_dir($this->cmsPath)) @@ -157,7 +161,8 @@ public function createTestingSite($use_htaccess = false) catch (Exception $e) { // Sorry, we tried :( - $this->say('Sorry, you will have to delete ' . $this->cmsPath . ' manually. '); + $this->say('Sorry, you will have to delete ' . $this->cmsPath . ' manually.'); + exit(1); } } @@ -175,7 +180,7 @@ public function createTestingSite($use_htaccess = false) } // Optionally uses Joomla default htaccess file. Used by TravisCI - if ($use_htaccess == true) + if ($useHtaccess == true) { $this->say("Renaming htaccess.txt to .htaccess"); $this->_copy('./htaccess.txt', $this->cmsPath . '/.htaccess'); @@ -373,7 +378,7 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) ->run() ->stopOnFail(); - /* + /** // Uncomment this lines if you need to debug selenium errors $seleniumErrors = file_get_contents('selenium.log'); @@ -387,7 +392,6 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) */ } - /** * Executes a specific Selenium System Tests in your machine * @@ -418,8 +422,9 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance') ); $tests = array(); + $i = 1; + $iterator->rewind(); - $i = 1; while ($iterator->valid()) { @@ -428,6 +433,7 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance') || strripos($iterator->getSubPathName(), '.feature')) { $this->say('[' . $i . '] ' . $iterator->getSubPathName()); + $tests[$i] = $iterator->getSubPathName(); $i++; } @@ -436,7 +442,7 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance') } $this->say(''); - $testNumber = $this->ask('Type the number of the test in the list that you want to run...'); + $testNumber = $this->ask('Type the number of the test in the list that you want to run...'); $test = $tests[$testNumber]; } @@ -456,7 +462,9 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance') $className = explode(".", $fileName[1]); $class_methods = get_class_methods($className[0]); + $this->say('[' . $i . '] ' . 'All'); + $methods[$i] = 'All'; $i++; @@ -467,7 +475,7 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance') if (!$reflect->isConstructor() && $reflect->isPublic()) { $this->say('[' . $i . '] ' . $method_name); - + $methods[$i] = $method_name; $i++; From dbafce2e8bb31b341afa749095e20d103bbaa95d Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 27 Aug 2016 17:40:42 +0200 Subject: [PATCH 2/2] robo --- RoboFile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index f35471a1c6..43c4631a4e 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -247,7 +247,7 @@ protected function copyJoomla($dst, $exclude = array()) * * @since __DEPLOY_VERSION__ * - * @return void + * @return void */ private function getComposer() { @@ -378,7 +378,7 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) ->run() ->stopOnFail(); - /** + /* // Uncomment this lines if you need to debug selenium errors $seleniumErrors = file_get_contents('selenium.log');