Skip to content
Closed
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
39 changes: 38 additions & 1 deletion src/JoomlaBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public function installExtensionFromFolder($path, $type = 'Extension')
/**
* Installs a Extension in Joomla that is located in a url
*
* @param String $url Url address to the .zip file
* @param string $url Url address to the .zip file
* @param string $type Type of Extension
*
* {@internal doAdminLogin() before}
Expand Down Expand Up @@ -393,6 +393,43 @@ public function installExtensionFromUrl($url, $type = 'Extension')
}
}

/**
* Installs a Extension in Joomla using the file upload option
*
* @param string $file Path to the file, which needs to reside in the _data folder
* @param string $type Type of Extension
*
* {@internal doAdminLogin() before}
*
* @return void
*/
public function installExtensionFromFileUpload($file, $type = 'Extension')
{
$I = $this;
$I->amOnPage('/administrator/index.php?option=com_installer');
$I->waitForText('Extensions: Install', '30', ['css' => 'H1']);
$I->click(['link' => 'Upload Package File']);
$this->debug('I enter the file input');
$I->attachFile(['id' => 'install_package'], $file);
$I->click(['id' => 'installbutton_package']);
$I->waitForText('was successful', '30', ['id' => 'system-message-container']);

if ($type == 'Extension')
{
$this->debug('Extension successfully installed.');
}

if ($type == 'Plugin')
{
$this->debug('Installing plugin was successful.');
}

if ($type == 'Package')
{
$this->debug('Installation of the package was successful.');
}
}

/**
* Function to check for PHP Notices or Warnings
*
Expand Down