- Notifications
You must be signed in to change notification settings - Fork6
joomla-extensions/search
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Drone-CI |
---|
Legacy Search provides a rudimentary search for the Joomla! CMS. To be able to search the data of a datasource from this, you have to provide a plugin for that. It is advised to use the built-in Smart Search component in Joomla instead of this one. This set of extensions is going to be supported until Joomla 5.0 is going to be released.
With thePatch Tester Component
Easily apply changes from a pull requests against this repo:Install the last release ofcom_search into your Joomla.Install the last release ofcom_patchtester into your Joomla (search is supported since Version 3.0.0 Alpha 2).Log into your site's administrator section, go to the Patch Tester Component Options (Components -> Patch Tester -> Options)Switch theGitHub Repository
toJoomla Search Package
. For this you have to fill the fieldGitHub Project Owner
withjoomla-extensions
and the fieldGitHub Project Repository
withsearch
.ClickSave & Close
and hit theFetch Data
Button to the the lastest pull requestsClickApply Patch
to apply the proposed changes from the pull request.ClickRevert Patch
to revert an applied patch.
You can read more about the Patch Tester extension on theJoomla! Documentation Wiki.
If you want to test a patch you can apply the patch via git.
If you cloned this repo under the name upstream - your remote is upstream – you can user the command
git fetch upstream pull/PR_NUMBER/head:BRANCHNUMER
for fetching the branch of the PRhttps://github.com/joomla-extensions/search/pull/290 this would be
git fetch upstream pull/290/head:move-lang-files
After that you can checkout the branch and start testing.
git checkout move-lang-files
$ cd /var/www/html//var/www/html$
/var/www/html$ git clone git@github.com:joomla-extensions/search.gitClone nach 'search' ...remote: Counting objects: 2446, done.remote: Compressing objects: 100% (75/75), done.remote: Total 2446 (delta 10), reused 0 (delta 0), pack-reused 2361Empfange Objekte: 100% (2446/2446), 615.02 KiB | 375.00 KiB/s, Fertig.Löse Unterschiede auf: 100% (1232/1232), Fertig.Prüfe Konnektivität ... Fertig.
Are you new with github? Here you can find informations about setting it up:https://help.github.com/articles/set-up-git/If you get an error you can try git clonehttps://github.com:joomla-extensions/search.git instead of git clonegit@github.com:joomla-extensions/search.git
/var/www/html$ cd search/var/www/html/search$
/var/www/html/search$ lscodeception.yml docs LICENSERoboFile.dist.ini testscomposer.json jed_update.xml manifest.xmlRoboFile.phpcomposer.lock jorobo.dist.ini README.mdsrc
5. Optional: Have a look into composer.json for information what software you will install via composer.
/var/www/html/search$ cat composer.json
orhttps://github.com/joomla-extensions/search/blob/master/composer.json
Read more abouthow to install composer here.
/var/www/html/search$export COMPOSER_PROCESS_TIMEOUT=1500;
/var/www/html/search$ composer installLoading composer repositories with package informationInstalling dependencies (including require-dev) from lock file - Installing symfony/yaml (v3.1.3) Downloading: 100%......Generating autoload files
8. After that you have to buildrobo
/var/www/html/search$ vendor/bin/robo build
If you use MySQL or PostgreSQL as database and your user has create database privileges the Database is automatically created by the Joomla installer.But the safest way is to create the database before running Joomla's web installer.
/var/www/html/search$ mysql -u root -pmysql> create database search;Query OK, 1 row affected (0,00 sec)mysql> quit;Bye
/var/www/html/search$ cd tests/var/www/html/search/tests$ cp acceptance.suite.dist.yml acceptance.suite.yml
11. Update the file acceptance.suite.yml to your needs. At least you have to update the options url, database name and counter_test_url.
/var/www/html/search/tests$ cat acceptance.suite.ymlclass_name: AcceptanceTestermodules: enabled: - JoomlaBrowser - AcceptanceHelper config: JoomlaBrowser: url: 'http://localhost/search/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms browser: 'firefox' window_size: 1024x768 capabilities: unexpectedAlertBehaviour: 'accept' username: 'admin' # UserName for the Administrator password: 'admin' # Password for the Administrator database host: 'localhost' # place where the Application is Hosted #server Address database user: 'root' # MySQL Server user ID, usually root database password: 'yourPassword' # MySQL Server password, usually empty or root database name: 'search' # DB Name, at the Server database type: 'mysqli' # type in lowercase one of the options: MySQL\MySQLi\PDO database prefix: 'jos_' # DB Prefix for tables install sample data: 'no' # Do you want to Download the Sample Data Along with Joomla Installation, then keep it Yes sample data: 'Default English (GB) Sample Data' # Default Sample Data admin email: 'admin@mydomain.com' # email Id of the Admin language: 'English (United Kingdom)' # Language in which you want the Application to be Installed AcceptanceHelper: repo_folder: '/home/travis/build/joomla-extensions/search/' # Path to the Extension repository. To be used by tests to install via Install from folder counter_test_url: 'http://localhost/search/tests/joomla-cms3' # the url for the weblink item used to test hits counter url: 'http://localhost/search/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice hereerror_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"env: desktop: ~ tablet: modules: config: JoomlaBrowser: window_size: 768x1024 phone: modules: config: JoomlaBrowser: window_size: 480x640
12. Optional: Go back to search directory and create and edit the file RoboFile.ini. Delete the local user www-data.
/var/www/html/search$ cp RoboFile.dist.ini RoboFile.ini/var/www/html/search$ cat RoboFile.ini; If set to true, the repo will not be cloned from GitHub and the local copy will be reused.; This setting will be obsolete once we have local Git cache enabledskipClone = false; If you want to setup your test website in a different folder, you can do that here.; You can also set an absolute path, i.e. /path/to/my/cms/foldercmsPath = tests/joomla-cms3; If you want to clone a different branch, you can set it herebranch = staging; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here.localUser =; Set this to true, if your curl binaries are not able to create an https connectioninsecure = false
/var/www/html/search$sudo chown -R username:usergroup /var/www
/var/www/html/search$ vendor/bin/robo run:testsClone nach 'tests/cache' ... [Exec] Done in 13.18s [FileSystem\CopyDir] Copied from tests/cache to tests/joomla-cms3...
The tests in search Extension use Codeception Testing Framework, if you want to know more about the technology used for testing please check:Testing Joomla Extensions with Codeception.
This is not required, and if in doubt you can just skip this section, but there may be some specific use cases when you need (or want) to override the default behaviour of RoboFile.php. To do this, copyRoboFile.dist.ini
toRoboFile.ini
and add options in INI format, one per line, e.g.
skipClone = truecmsPath = tests/joomla-cms3
The currently available options are as follows:
skipClone
: set totrue
to avoid the cms repo being deleted and re-cloned at each test execution. Useful to save time and bandwidth while you're debugging your test environment. But please be aware that if you don't refresh the repo you'll have to manually check theinstallation
folder is present and theconfiguration.php
is not.cmsPath
: set to the local path (absolute or relative) where you'd like the test website to be installed. Default istests/joomla-cms3
.branch
: set to whatever existing branch from thejoomla-cms
project if you want to clone that specific branch. Default isstaging
.
You can run the tests against different resolutions. The default acceptance YAML configuration file provides three options:
- "desktop": default, 1024x768px
- "tablet": tablet in portrait mode, 768x1024px
- "phone": phone in portrait mode, 480x640px
To set a specific resolution, set is as an option of the command:
$ vendor/bin/robo run:tests --env=tablet
Note: the first parameter is used by Travis and you should always set it to "0" when you run your tests locally.
Here you can finde a video that shows the installation of com_search for testing.
You need to install:
- Git for windows (https://msysgit.github.io/)
- GitHub for windows (https://windows.github.com/)
- Curl for Windows if necessary.
- for complete list of necessary software and tips check thiswiki page
Note: For commands line is better if you use the 'Git shell' program.
First you should create a fork of the official repository and clone the fork into your web server folder.
To prepare the system tests (Selenium) to be run in your local machine you are asked to rename the filetests/acceptance.suite.dist.yml
totests/acceptance.suite.yml
. Afterwards, please edit the file according to your system needs.
The next step is only required if you don't place the search folder into your web server folder. Create a symbolic link from your tests\joomla-cms3 to a subfolder of your web server. For example:
mklink /J C:\wamp\www\tests\joomla-cms3 C:\Users\Name\Documents\GitHub\search\tests\joomla-cms3
Open the console and go in the folder of search, for example:
cd C:\wamp\www\search
Then run the command:
$ composer install
You can then run the following command to start the tests:
$ vendor/bin/robo run:tests
Once all tests were executed, you may also run a specific test:
$ vendor/bin/robo run:test // Thenselectthetest you want to run!