@@ -237,28 +237,43 @@ public function setErrorReportingToDevelopment()
237237 * @param string $type Type of Extension
238238 *
239239 * @note: doAdminLogin() before
240+ *
241+ * @deprecated since Joomla 3.4.4-dev. Use installExtensionFromFolder($path, $type = 'Extension') instead.
240242 */
241243 public function installExtensionFromDirectory ($ path , $ type = 'Extension ' )
242244 {
243- $ I = $ this ;
244- $ I ->amOnPage ('/administrator/index.php?option=com_installer ' );
245- $ I ->waitForText ('Extensions: Install ' ,'30 ' , ['css ' => 'H1 ' ]);
246- $ I ->click (['link ' => 'Install from Folder ' ]);
247- $ this ->debug ('I enter the Path ' );
248- $ I ->fillField (['id ' => 'install_directory ' ], $ path );
249- // @todo: we need to find a better locator for the following Install button
250- $ I ->click (['xpath ' => "//input[contains(@onclick,'Joomla.submitbutton3()')] " ]); // Install button
251- $ I ->waitForText ('was successful ' ,'30 ' , ['id ' => 'system-message-container ' ]);
252- if ($ type == 'Extension ' )
253- {
254- $ this ->debug ('Extension successfully installed from ' . $ path );
255- }
256- if ($ type == 'Plugin ' )
257- {
258- $ this ->debug ('Installing plugin was successful. ' . $ path );
259- }
245+ $ this ->debug ('Suggested to use installExtensionFromFolder instead of installExtensionFromDirectory ' );
246+ $ this ->installExtensionFromFolder ($ path , $ type );
260247 }
261248
249+ /**
250+ * Installs a Extension in Joomla that is located in a folder inside the server
251+ *
252+ * @param String $path Path for the Extension
253+ * @param string $type Type of Extension
254+ *
255+ * @note: doAdminLogin() before
256+ */
257+ public function installExtensionFromFolder ($ path , $ type = 'Extension ' )
258+ {
259+ $ I = $ this ;
260+ $ I ->amOnPage ('/administrator/index.php?option=com_installer ' );
261+ $ I ->waitForText ('Extensions: Install ' ,'30 ' , ['css ' => 'H1 ' ]);
262+ $ I ->click (['link ' => 'Install from Folder ' ]);
263+ $ this ->debug ('I enter the Path ' );
264+ $ I ->fillField (['id ' => 'install_directory ' ], $ path );
265+ // @todo: we need to find a better locator for the following Install button
266+ $ I ->click (['xpath ' => "//input[contains(@onclick,'Joomla.submitbutton3()')] " ]); // Install button
267+ $ I ->waitForText ('was successful ' ,'30 ' , ['id ' => 'system-message-container ' ]);
268+ if ($ type == 'Extension ' )
269+ {
270+ $ this ->debug ('Extension successfully installed from ' . $ path );
271+ }
272+ if ($ type == 'Plugin ' )
273+ {
274+ $ this ->debug ('Installing plugin was successful. ' . $ path );
275+ }
276+ }
262277 /**
263278 * Installs a Extension in Joomla that is located in a url
264279 *
0 commit comments