Skip to content
Merged
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
37 changes: 37 additions & 0 deletions src/JoomlaBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,43 @@ public function installExtensionFromUrl($url, $type = 'Extension')
}
}

/**
* Installs a Extension in Joomla using the file upload option
*
* @param string $file Path to the file in the _data folder
* @param string $type Type of Extension
*
* {@internal doAdminLogin() before}
*
* @return void
*/
public function installExtensionFromFileUpload($file, $type = 'Extension')
{
$this->amOnPage('/administrator/index.php?option=com_installer');
$this->waitForText('Extensions: Install', '30', array('css' => 'H1'));
$this->click(array('link' => 'Upload Package File'));

$this->debug('I make sure legacy uploader is visible');
$this->executeJS('document.getElementById("legacy-uploader").style.display="block";');

$this->debug('I enter the file input');
$this->attachFile(array('id' => 'install_package'), $file);

$this->waitForText('was successful', '30', array('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