From 59461993c3fd5068d0f8793b2b4721f1fe52a36c Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Mon, 27 Jul 2015 20:04:25 +0530 Subject: [PATCH 1/4] Adding installExtensionFromFolder function --- src/JoomlaBrowser.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 8b0b345..6f894e0 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -237,10 +237,13 @@ public function setErrorReportingToDevelopment() * @param string $type Type of Extension * * @note: doAdminLogin() before + * + * **With respect to the recent changes in Joomla! this function will be removed hence update your tests to use installExtensionFromFolder() instead of installExtensionFromDirectory */ public function installExtensionFromDirectory($path, $type = 'Extension') { $I = $this; + $this->debug('With respect to the recent changes in Joomla! installExtensionFromDirectory function will be removed from Joomla-Browser hence update your tests to use installExtensionFromFolder instead of installExtensionFromDirectory'); $I->amOnPage('/administrator/index.php?option=com_installer'); $I->waitForText('Extensions: Install','30', ['css' => 'H1']); $I->click(['link' => 'Install from Folder']); @@ -259,6 +262,34 @@ public function installExtensionFromDirectory($path, $type = 'Extension') } } + /** + * Installs a Extension in Joomla that is located in a folder inside the server + * + * @param String $path Path for the Extension + * @param string $type Type of Extension + * + * @note: doAdminLogin() before + */ + public function installExtensionFromFolder($path, $type = 'Extension') + { + $I = $this; + $I->amOnPage('/administrator/index.php?option=com_installer'); + $I->waitForText('Extensions: Install','30', ['css' => 'H1']); + $I->click(['link' => 'Install from Folder']); + $this->debug('I enter the Path'); + $I->fillField(['id' => 'install_directory'], $path); + // @todo: we need to find a better locator for the following Install button + $I->click(['xpath' => "//input[contains(@onclick,'Joomla.submitbutton3()')]"]); // Install button + $I->waitForText('was successful','30', ['id' => 'system-message-container']); + if ($type == 'Extension') + { + $this->debug('Extension successfully installed from ' . $path); + } + if ($type == 'Plugin') + { + $this->debug('Installing plugin was successful.' . $path); + } + } /** * Installs a Extension in Joomla that is located in a url * From 8be576341a50d6a87bbe38b5eb92d9189a6fc5b8 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Mon, 27 Jul 2015 20:06:47 +0530 Subject: [PATCH 2/4] Updating Function list in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b02557e..538371d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ In between the available functions you can find: * search for item * check for item existence * EXTENSION MANAGER - * install extension from directory + * install extension from Folder * install extension from url * enable plugin * uninstall extension From 476abf699d79d21d950a8343ba4acdc981f3b192 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Mon, 27 Jul 2015 20:17:01 +0530 Subject: [PATCH 3/4] adding a call to installExtensionFromFolder function --- src/JoomlaBrowser.php | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 6f894e0..b548785 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -237,29 +237,11 @@ public function setErrorReportingToDevelopment() * @param string $type Type of Extension * * @note: doAdminLogin() before - * - * **With respect to the recent changes in Joomla! this function will be removed hence update your tests to use installExtensionFromFolder() instead of installExtensionFromDirectory */ public function installExtensionFromDirectory($path, $type = 'Extension') { - $I = $this; - $this->debug('With respect to the recent changes in Joomla! installExtensionFromDirectory function will be removed from Joomla-Browser hence update your tests to use installExtensionFromFolder instead of installExtensionFromDirectory'); - $I->amOnPage('/administrator/index.php?option=com_installer'); - $I->waitForText('Extensions: Install','30', ['css' => 'H1']); - $I->click(['link' => 'Install from Folder']); - $this->debug('I enter the Path'); - $I->fillField(['id' => 'install_directory'], $path); - // @todo: we need to find a better locator for the following Install button - $I->click(['xpath' => "//input[contains(@onclick,'Joomla.submitbutton3()')]"]); // Install button - $I->waitForText('was successful','30', ['id' => 'system-message-container']); - if ($type == 'Extension') - { - $this->debug('Extension successfully installed from ' . $path); - } - if ($type == 'Plugin') - { - $this->debug('Installing plugin was successful.' . $path); - } + $this->debug('Suggested to use installExtensionFromFolder instead of installExtensionFromDirectory'); + $this->installExtensionFromFolder($path, $type); } /** From 7bceb2409440035ab208923c058f8ba33f5e977e Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Mon, 27 Jul 2015 20:26:17 +0530 Subject: [PATCH 4/4] Adding Deprecated Tag --- src/JoomlaBrowser.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index b548785..2c3d94e 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -237,6 +237,8 @@ public function setErrorReportingToDevelopment() * @param string $type Type of Extension * * @note: doAdminLogin() before + * + * @deprecated since Joomla 3.4.4-dev. Use installExtensionFromFolder($path, $type = 'Extension') instead. */ public function installExtensionFromDirectory($path, $type = 'Extension') {