Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 32 additions & 17 deletions src/JoomlaBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,28 +237,43 @@ 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.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the deprecated

     * ...
     *
     * @deprecated  since Joomla 3.4.4-dev. Use installExtensionFromFolder($path, $type = 'Extension') instead.
     */

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! thanks 👍

public function installExtensionFromDirectory($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);
}
$this->debug('Suggested to use installExtensionFromFolder instead of installExtensionFromDirectory');
$this->installExtensionFromFolder($path, $type);
}

/**
* 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
*
Expand Down