From dca52551693b283f031532fcc197c14cf40efe81 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Sat, 21 May 2016 15:57:03 +0200 Subject: [PATCH 01/40] Update Joomla Browser to J3.6. --- composer.json | 2 +- composer.lock | 270 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 187 insertions(+), 85 deletions(-) diff --git a/composer.json b/composer.json index 23d219d..d7a0990 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ }, "require-dev": { "codeception/codeception": "~2.1", - "joomla-projects/joomla-browser": "v3.4.8.3", + "joomla-projects/joomla-browser": "v3.6.0", "codegyre/robo": "~0.5", "joomla-projects/robo": "dev-master", "joomla-projects/selenium-server-standalone": "v2.52.0", diff --git a/composer.lock b/composer.lock index c6d8396..05b6ce3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e294320be55c99fcb917d928cb7a8d2d", - "content-hash": "8fde1d658239c211da1d63b9da0f706f", + "hash": "1d278248959c97dd9542b4d742b69946", + "content-hash": "ccb1216dacf94fe049baf27294cd255d", "packages": [], "packages-dev": [ { @@ -378,7 +378,6 @@ ], "description": "Composer installable Coding Standards Definition.", "homepage": "https://github.com/GreenCape/coding-standards", - "abandoned": "greencape/coding-standards", "time": "2015-07-03 12:01:28" }, { @@ -445,16 +444,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8" + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bb9024c526b22f3fe6ae55a561fd70653d470aa8", - "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8", + "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", "shasum": "" }, "require": { @@ -492,7 +491,7 @@ "keywords": [ "promise" ], - "time": "2016-03-08 01:15:46" + "time": "2016-05-18 16:56:05" }, { "name": "guzzlehttp/psr7", @@ -1216,17 +1215,59 @@ "time": "2015-08-17 06:30:58" }, { - "name": "joomla-projects/joomla-browser", - "version": "v3.4.8.3", + "name": "ircmaxell/password-compat", + "version": "v1.0.4", "source": { "type": "git", - "url": "https://github.com/joomla-projects/joomla-browser.git", - "reference": "d11139fadc2f8205b0060a4fa01d4c6f39f80533" + "url": "https://github.com/ircmaxell/password_compat.git", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/d11139fadc2f8205b0060a4fa01d4c6f39f80533", - "reference": "d11139fadc2f8205b0060a4fa01d4c6f39f80533", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "autoload": { + "files": [ + "lib/password.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Ferrara", + "email": "ircmaxell@php.net", + "homepage": "http://blog.ircmaxell.com" + } + ], + "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", + "homepage": "https://github.com/ircmaxell/password_compat", + "keywords": [ + "hashing", + "password" + ], + "time": "2014-11-20 16:49:30" + }, + { + "name": "joomla-projects/joomla-browser", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-projects/joomla-browser.git", + "reference": "b0a583d09435d9941219fef06fcc27a6487df976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/b0a583d09435d9941219fef06fcc27a6487df976", + "reference": "b0a583d09435d9941219fef06fcc27a6487df976", "shasum": "" }, "require": { @@ -1264,7 +1305,7 @@ "acceptance testing", "joomla" ], - "time": "2016-04-25 08:59:49" + "time": "2016-05-21 13:48:02" }, { "name": "joomla-projects/jorobo", @@ -1573,22 +1614,23 @@ }, { "name": "joomla/registry", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/joomla-framework/registry.git", - "reference": "b9fd1812e19619bb4722a0711b691dbfefff8ee9" + "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/registry/zipball/b9fd1812e19619bb4722a0711b691dbfefff8ee9", - "reference": "b9fd1812e19619bb4722a0711b691dbfefff8ee9", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/bd3592c6f0554a72811df52aeaea98c7815f6e5a", + "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a", "shasum": "" }, "require": { "joomla/compat": "~1.0", "joomla/utilities": "~1.0", - "php": ">=5.3.10|>=7.0" + "php": ">=5.3.10|>=7.0", + "symfony/polyfill-php55": "~1.0" }, "require-dev": { "joomla/test": "~1.0", @@ -1621,7 +1663,7 @@ "joomla", "registry" ], - "time": "2016-04-18 23:57:43" + "time": "2016-05-14 20:42:05" }, { "name": "joomla/string", @@ -2256,21 +2298,24 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ @@ -2293,7 +2338,7 @@ "keywords": [ "timer" ], - "time": "2015-06-21 08:01:12" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", @@ -2346,16 +2391,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.24", + "version": "4.8.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", "shasum": "" }, "require": { @@ -2369,7 +2414,7 @@ "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", @@ -2414,7 +2459,7 @@ "testing", "xunit" ], - "time": "2016-03-14 06:16:08" + "time": "2016-05-17 03:09:28" }, { "name": "phpunit/phpunit-mock-objects", @@ -2639,16 +2684,16 @@ }, { "name": "sebastian/environment", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { @@ -2685,7 +2730,7 @@ "environment", "hhvm" ], - "time": "2016-02-26 18:40:46" + "time": "2016-05-17 03:18:57" }, { "name": "sebastian/exporter", @@ -3104,7 +3149,7 @@ }, { "name": "symfony/browser-kit", - "version": "v3.0.4", + "version": "v3.0.6", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -3161,16 +3206,16 @@ }, { "name": "symfony/config", - "version": "v2.8.4", + "version": "v2.8.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c" + "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/5273f4724dc5288fe7a33cb08077ab9852621f2c", - "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c", + "url": "https://api.github.com/repos/symfony/config/zipball/edbbcf33cffa2a85104fc80de8dc052cc51596bb", + "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb", "shasum": "" }, "require": { @@ -3210,20 +3255,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:54:35" + "time": "2016-04-20 18:52:26" }, { "name": "symfony/console", - "version": "v2.8.4", + "version": "v2.8.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154" + "reference": "48221d3de4dc22d2cd57c97e8b9361821da86609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9a5aef5fc0d4eff86853d44202b02be8d5a20154", - "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154", + "url": "https://api.github.com/repos/symfony/console/zipball/48221d3de4dc22d2cd57c97e8b9361821da86609", + "reference": "48221d3de4dc22d2cd57c97e8b9361821da86609", "shasum": "" }, "require": { @@ -3270,11 +3315,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-03-17 09:19:04" + "time": "2016-04-26 12:00:47" }, { "name": "symfony/css-selector", - "version": "v3.0.4", + "version": "v3.0.6", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -3327,16 +3372,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v2.8.4", + "version": "v2.8.6", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "f7b4a498e679fa440b16facb934680a1527ed48c" + "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f7b4a498e679fa440b16facb934680a1527ed48c", - "reference": "f7b4a498e679fa440b16facb934680a1527ed48c", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bd04588c087651ceffdc45d40dc4de05af9c7c52", + "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52", "shasum": "" }, "require": { @@ -3352,6 +3397,7 @@ }, "suggest": { "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, @@ -3385,20 +3431,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-03-21 07:27:21" + "time": "2016-05-09 18:12:35" }, { "name": "symfony/dom-crawler", - "version": "v3.0.4", + "version": "v3.0.6", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f" + "reference": "49b588841225b205700e5122fa01911cabada857" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/18a06d7a9af41718c20764a674a0ebba3bc40d1f", - "reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/49b588841225b205700e5122fa01911cabada857", + "reference": "49b588841225b205700e5122fa01911cabada857", "shasum": "" }, "require": { @@ -3441,20 +3487,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2016-03-23 13:23:25" + "time": "2016-04-12 18:09:53" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.4", + "version": "v2.8.6", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87" + "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87", - "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8", + "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8", "shasum": "" }, "require": { @@ -3501,20 +3547,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-03-07 14:04:32" + "time": "2016-05-03 18:59:18" }, { "name": "symfony/filesystem", - "version": "v2.8.4", + "version": "v2.8.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "f08ffdf229252cd2745558cb2112df43903bcae4" + "reference": "dee379131dceed90a429e951546b33edfe7dccbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/f08ffdf229252cd2745558cb2112df43903bcae4", - "reference": "f08ffdf229252cd2745558cb2112df43903bcae4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/dee379131dceed90a429e951546b33edfe7dccbb", + "reference": "dee379131dceed90a429e951546b33edfe7dccbb", "shasum": "" }, "require": { @@ -3550,11 +3596,11 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-03-27 10:20:16" + "time": "2016-04-12 18:01:21" }, { "name": "symfony/finder", - "version": "v2.8.4", + "version": "v2.8.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -3603,16 +3649,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "1289d16209491b584839022f29257ad859b8532d" + "reference": "dff51f72b0706335131b00a7f49606168c582594" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", - "reference": "1289d16209491b584839022f29257ad859b8532d", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", "shasum": "" }, "require": { @@ -3624,7 +3670,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -3658,20 +3704,76 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { - "name": "symfony/process", - "version": "v2.8.4", + "name": "symfony/polyfill-php55", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "fb467471952ef5cf8497c029980e556b47545333" + "url": "https://github.com/symfony/polyfill-php55.git", + "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/fb467471952ef5cf8497c029980e556b47545333", - "reference": "fb467471952ef5cf8497c029980e556b47545333", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", + "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", + "shasum": "" + }, + "require": { + "ircmaxell/password-compat": "~1.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php55\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-05-18 14:26:46" + }, + { + "name": "symfony/process", + "version": "v2.8.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "1276bd9be89be039748cf753a2137f4ef149cd74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/1276bd9be89be039748cf753a2137f4ef149cd74", + "reference": "1276bd9be89be039748cf753a2137f4ef149cd74", "shasum": "" }, "require": { @@ -3707,11 +3809,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-03-23 13:11:46" + "time": "2016-04-14 15:22:22" }, { "name": "symfony/yaml", - "version": "v3.0.4", + "version": "v3.0.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", From c8108bc9ebf7e6da8e8bc268cf8cfa46c39bd687 Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Sat, 21 May 2016 17:54:07 +0200 Subject: [PATCH 02/40] Update firefox version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 34b0c3e..4bf5422 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ php: - 5.5 - 5.6 addons: - firefox: "44.0.2" + firefox: "46.0.1" matrix: allow_failures: - php: 5.6 From 3d6cfeef14ed3f3370ca1de49e09a806155098e3 Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Sat, 21 May 2016 21:55:51 +0200 Subject: [PATCH 03/40] Php7 Support --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 34b0c3e..84d04bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,12 @@ language: php php: - 5.5 - 5.6 +- 7.0 addons: firefox: "44.0.2" matrix: allow_failures: - - php: 5.6 + - php: 7.0 before_script: - sudo apt-get update -qq - sudo apt-get install -y --force-yes apache2 libapache2-mod-fastcgi php5-curl php5-mysql php5-intl php5-gd > /dev/null From 9116cae63de1fe8b64227f525230787523f20abd Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Mon, 30 May 2016 20:12:33 +0100 Subject: [PATCH 04/40] First simple attempt at Smart Search test. --- .../AdministratorSmartSearchCest.php | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 tests/acceptance/administrator/AdministratorSmartSearchCest.php diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php new file mode 100644 index 0000000..c194f1d --- /dev/null +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -0,0 +1,143 @@ +faker = Faker\Factory::create(); + $this->title = 'SmartSearch' . $this->faker->randomNumber(); + $this->articletext = 'This is a test'; + } + + /* + * Before the tests proper, switch the WYSIWYG editor off. + * This is to make it easier to create test content. + */ + public function administratorDisableEditor(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Disable the editor before the tests proper'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the plugin'); + $I->amOnPage('administrator/index.php?option=com_config'); + $I->waitForText('Global Configuration', '30', ['css' => 'h1']); + $I->selectOptionInChosen('Default Editor', 'Editor - None'); + $I->clickToolbarButton('Save & Close'); + $I->waitForText('Control Panel', '30', ['css' => 'h1']); + $I->expectTo('see a success message after saving the configuration'); + $I->see('Configuration successfully saved', ['id' => 'system-message-container']); + } + + /* + * Before the tests proper, the Smart Search content plugin must be enabled. + */ + public function administratorEnableContentPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Enabling the Smart Search content plugin before the tests proper'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Smart Search page in /administrator/'); + $I->amOnPage('administrator/index.php?option=com_finder'); + $I->expectTo('see a message saying that the content plugin should be enabled'); + $I->waitForElement(['link' => 'enable this plugin']); + $I->click(['link' => 'enable this plugin']); + $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->waitForElement(['link' => 'Content - Smart Search']); + $I->checkOption(['id' => 'cb0']); + $I->clickToolbarButton('Publish'); // Note: The button is called "Enable", but we need to call it "Publish" here. + $I->waitForText('Plugin successfully enabled', '30', ['class' => 'alert-message']); + } + + /* + * Purge the index. + */ + public function administratorPurgeIndex(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Purging the index'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Smart Search page in /administrator/ and purge the index'); + $I->amOnPage('administrator/index.php?option=com_finder'); + $I->waitForText('Smart Search', '30', ['css' => 'h1']); + $I->clickToolbarButton('Trash'); // Note: The button is called "Clear Index", but we need to call it "Trash" here. + $I->acceptPopup(); + $I->waitForText('All items have been successfully deleted', '30', ['class' => 'alert-message']); + } + + /* + * Index the current content. + */ + public function administratorRunTheIndexer(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Smart Search Indexer'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Smart Search page in /administrator/ and index the content'); + $I->amOnPage('administrator/index.php?option=com_finder'); + $I->waitForText('Smart Search: Indexed Content', '30', ['css' => 'h1']); + $I->click(['css' => 'button[data-target="#modal-archive"]']); + $I->wait(5); + $I->switchToIframe('Smart Search Indexer'); + + // Put something here to check that it worked. + } + + /* + * Add a new article. + * Since the content plugin is enabled, this will add the article to the search index. + */ + public function administratorAddNewArticle(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Adding a new article before the tests proper'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Article Manager Edit page in /administrator/ and create a new article'); + $I->amOnPage('administrator/index.php?option=com_content&view=article&layout=edit'); + $I->waitForText('Articles: New', '30', ['css' => 'h1']); + + $I->fillField(['id' => 'jform_title'], $this->title); + $I->fillField(['id' => 'jform_articletext'], $this->articletext); + $I->clickToolbarButton('Save & Close'); + $I->waitForText('Articles', '30', ['css' => 'h1']); + $I->expectTo('see a success message and the article added after saving it'); + $I->see('Article successfully saved', ['id' => 'system-message-container']); + $I->see($this->title, ['id' => 'articleList']); + } + + /* + * After the tests, the Smart Search content plugin must be disabled, ready for the next test. + */ + public function administratorDisableContentPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Disabling the Smart Search content plugin, ready for the next test run'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Plugins page in /administrator/ and disable the Smart Search Content plugin'); + $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins&filter[search]=Content - Smart Search'); + $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->waitForElement(['link' => 'Content - Smart Search']); + $I->checkOption(['id' => 'cb0']); + $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. + $I->waitForText('Plugin successfully disabled', '30', ['class' => 'alert-message']); + } +} + From b9b95daccc4099ab6886a40aa0cb53e64328effb Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Tue, 31 May 2016 09:26:32 +0100 Subject: [PATCH 05/40] Reduce the iframe wait time. --- tests/acceptance/administrator/AdministratorSmartSearchCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php index c194f1d..deb981d 100644 --- a/tests/acceptance/administrator/AdministratorSmartSearchCest.php +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -91,7 +91,7 @@ class AdministratorSmartSearchCest $I->amOnPage('administrator/index.php?option=com_finder'); $I->waitForText('Smart Search: Indexed Content', '30', ['css' => 'h1']); $I->click(['css' => 'button[data-target="#modal-archive"]']); - $I->wait(5); + $I->wait(1); $I->switchToIframe('Smart Search Indexer'); // Put something here to check that it worked. From 55f2b835ec9a320338b7230c9594bf9b519f453d Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Sat, 4 Jun 2016 23:19:17 +0100 Subject: [PATCH 06/40] Improvements suggested by @pritalpatel. Thanks Prital. --- .../AdministratorSmartSearchCest.php | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php index deb981d..1edc734 100644 --- a/tests/acceptance/administrator/AdministratorSmartSearchCest.php +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -29,10 +29,10 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the plugin'); $I->amOnPage('administrator/index.php?option=com_config'); - $I->waitForText('Global Configuration', '30', ['css' => 'h1']); + $I->waitForText('Global Configuration', 30, ['class' => 'page-title']); $I->selectOptionInChosen('Default Editor', 'Editor - None'); $I->clickToolbarButton('Save & Close'); - $I->waitForText('Control Panel', '30', ['css' => 'h1']); + $I->waitForText('Control Panel', 30, ['class'=> 'page-title']); $I->expectTo('see a success message after saving the configuration'); $I->see('Configuration successfully saved', ['id' => 'system-message-container']); } @@ -52,11 +52,11 @@ class AdministratorSmartSearchCest $I->expectTo('see a message saying that the content plugin should be enabled'); $I->waitForElement(['link' => 'enable this plugin']); $I->click(['link' => 'enable this plugin']); - $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->waitForText('Plugins', 30, ['class'=> 'page-title']); $I->waitForElement(['link' => 'Content - Smart Search']); $I->checkOption(['id' => 'cb0']); $I->clickToolbarButton('Publish'); // Note: The button is called "Enable", but we need to call it "Publish" here. - $I->waitForText('Plugin successfully enabled', '30', ['class' => 'alert-message']); + $I->waitForText('Plugin successfully enabled', 30, ['class' => 'alert-message']); } /* @@ -71,10 +71,10 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to the Smart Search page in /administrator/ and purge the index'); $I->amOnPage('administrator/index.php?option=com_finder'); - $I->waitForText('Smart Search', '30', ['css' => 'h1']); + $I->waitForText('Smart Search', 30, ['class'=> 'page-title']); $I->clickToolbarButton('Trash'); // Note: The button is called "Clear Index", but we need to call it "Trash" here. $I->acceptPopup(); - $I->waitForText('All items have been successfully deleted', '30', ['class' => 'alert-message']); + $I->waitForText('All items have been successfully deleted', 30, ['class' => 'alert-message']); } /* @@ -89,10 +89,11 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to Smart Search page in /administrator/ and index the content'); $I->amOnPage('administrator/index.php?option=com_finder'); - $I->waitForText('Smart Search: Indexed Content', '30', ['css' => 'h1']); + $I->waitForText('Smart Search: Indexed Content', 30, ['class'=> 'page-title']); $I->click(['css' => 'button[data-target="#modal-archive"]']); $I->wait(1); - $I->switchToIframe('Smart Search Indexer'); + $I->switchToIFrame('Smart Search Indexer'); + $I->checkForPhpNoticesOrWarnings(); // Put something here to check that it worked. } @@ -100,6 +101,8 @@ class AdministratorSmartSearchCest /* * Add a new article. * Since the content plugin is enabled, this will add the article to the search index. + * + * @todo Revisit this when Gherkin is available. */ public function administratorAddNewArticle(\Step\Acceptance\weblink $I) { @@ -109,13 +112,15 @@ class AdministratorSmartSearchCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to the Article Manager Edit page in /administrator/ and create a new article'); - $I->amOnPage('administrator/index.php?option=com_content&view=article&layout=edit'); - $I->waitForText('Articles: New', '30', ['css' => 'h1']); + $I->amOnPage('administrator/index.php?option=com_content'); + $I->waitForText('Articles', 30, ['class'=> 'page-title']); + $I->clickToolbarButton('New'); + $I->waitForText('Articles: New', 30, ['class'=> 'page-title']); $I->fillField(['id' => 'jform_title'], $this->title); $I->fillField(['id' => 'jform_articletext'], $this->articletext); $I->clickToolbarButton('Save & Close'); - $I->waitForText('Articles', '30', ['css' => 'h1']); + $I->waitForText('Articles', 30, ['class'=> 'page-title']); $I->expectTo('see a success message and the article added after saving it'); $I->see('Article successfully saved', ['id' => 'system-message-container']); $I->see($this->title, ['id' => 'articleList']); @@ -132,12 +137,13 @@ class AdministratorSmartSearchCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Plugins page in /administrator/ and disable the Smart Search Content plugin'); - $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins&filter[search]=Content - Smart Search'); - $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins'); + $I->searchForItem('Content - Smart Search'); + $I->waitForText('Plugins', 30, ['class'=> 'page-title']); $I->waitForElement(['link' => 'Content - Smart Search']); $I->checkOption(['id' => 'cb0']); $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. - $I->waitForText('Plugin successfully disabled', '30', ['class' => 'alert-message']); + $I->waitForText('Plugin successfully disabled', 30, ['class' => 'alert-message']); } } From d2ae0fb8301b56f978b742ad510dd178dfd64f91 Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Thu, 9 Jun 2016 18:34:47 +0200 Subject: [PATCH 07/40] Update Composer (#218) Update Composer. Add Gherkin. Update new version codeception 2.2.1. Update jorobo. Merged on review. --- composer.json | 7 +- composer.lock | 198 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 136 insertions(+), 69 deletions(-) diff --git a/composer.json b/composer.json index d7a0990..1dfb90d 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,13 @@ "php": ">=5.3.10" }, "require-dev": { - "codeception/codeception": "~2.1", + "codeception/codeception": "^2.2", "joomla-projects/joomla-browser": "v3.6.0", "codegyre/robo": "~0.5", "joomla-projects/robo": "dev-master", - "joomla-projects/selenium-server-standalone": "v2.52.0", + "joomla-projects/selenium-server-standalone": "v2.53.0.1", "fzaninotto/faker": "^1.5", - "joomla-projects/jorobo": "0.3" + "joomla-projects/jorobo": "0.4", + "Behat/Gherkin": "^4.4.1" } } diff --git a/composer.lock b/composer.lock index 05b6ce3..fd96f3d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,25 +4,84 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "1d278248959c97dd9542b4d742b69946", - "content-hash": "ccb1216dacf94fe049baf27294cd255d", + "hash": "87c538127e912beb7f81120234148278", + "content-hash": "9f0da75ef3fec4dd00045e1882077fb2", "packages": [], "packages-dev": [ { - "name": "codeception/codeception", - "version": "2.1.8", + "name": "behat/gherkin", + "version": "v4.4.1", "source": { "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "f3daa61f0f11c531b33eb3623ab0daa599d88a79" + "url": "https://github.com/Behat/Gherkin.git", + "reference": "1576b485c0f92ef6d27da9c4bbfc57ee30cf6911" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/f3daa61f0f11c531b33eb3623ab0daa599d88a79", - "reference": "f3daa61f0f11c531b33eb3623ab0daa599d88a79", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/1576b485c0f92ef6d27da9c4bbfc57ee30cf6911", + "reference": "1576b485c0f92ef6d27da9c4bbfc57ee30cf6911", "shasum": "" }, "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "symfony/yaml": "~2.1" + }, + "suggest": { + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Cucumber", + "DSL", + "gherkin", + "parser" + ], + "time": "2015-12-30 14:47:00" + }, + { + "name": "codeception/codeception", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Codeception.git", + "reference": "f137636f0c185e7d4a495b9cea70c1afae27dfc7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/f137636f0c185e7d4a495b9cea70c1afae27dfc7", + "reference": "f137636f0c185e7d4a495b9cea70c1afae27dfc7", + "shasum": "" + }, + "require": { + "behat/gherkin": "~4.4.0", "ext-json": "*", "ext-mbstring": "*", "facebook/webdriver": ">=1.0.1 <2.0", @@ -30,29 +89,36 @@ "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0 <8.0", "phpunit/php-code-coverage": ">=2.1.3", - "phpunit/phpunit": ">4.8.20 <6.0", - "symfony/browser-kit": ">=2.5 <3.1", - "symfony/console": ">=2.5 <3.1", - "symfony/css-selector": ">=2.5 <3.1", - "symfony/dom-crawler": ">=2.5 <3.1", - "symfony/event-dispatcher": ">=2.5 <3.1", - "symfony/finder": ">=2.5 <3.1", - "symfony/yaml": ">=2.5 <3.1" + "phpunit/phpunit": ">4.8.20 <5.5", + "symfony/browser-kit": ">=2.7 <4.0", + "symfony/console": ">=2.7 <4.0", + "symfony/css-selector": ">=2.7 <4.0", + "symfony/dom-crawler": ">=2.7 <4.0", + "symfony/event-dispatcher": ">=2.7 <4.0", + "symfony/finder": ">=2.7 <4.0", + "symfony/yaml": ">=2.7 <4.0" }, "require-dev": { "codeception/specify": "~0.3", "facebook/php-sdk-v4": "~5.0", "flow/jsonpath": "~0.2", + "league/factory-muffin": "^3.0", + "league/factory-muffin-faker": "^1.0", + "mongodb/mongodb": "^1.0", "monolog/monolog": "~1.8", - "pda/pheanstalk": "~2.0", - "php-amqplib/php-amqplib": "~2.4" + "pda/pheanstalk": "~3.0", + "php-amqplib/php-amqplib": "~2.4", + "predis/predis": "^1.0", + "squizlabs/php_codesniffer": "~2.0" }, "suggest": { - "codeception/phpbuiltinserver": "Extension to start and stop PHP built-in web server for your tests", "codeception/specify": "BDD-style code blocks", "codeception/verify": "BDD-style assertions", - "monolog/monolog": "Log test steps", - "phpseclib/phpseclib": "Extension required to use the SFTP option in the FTP Module." + "flow/jsonpath": "For using JSONPath in REST module", + "league/factory-muffin": "For DataFactory module", + "league/factory-muffin-faker": "For Faker support in DataFactory module", + "phpseclib/phpseclib": "for SFTP option in FTP Module", + "symfony/phpunit-bridge": "For phpunit-bridge support" }, "bin": [ "codecept" @@ -87,7 +153,7 @@ "functional testing", "unit testing" ], - "time": "2016-04-15 02:56:43" + "time": "2016-06-03 12:44:06" }, { "name": "codegyre/robo", @@ -1309,16 +1375,16 @@ }, { "name": "joomla-projects/jorobo", - "version": "0.3.0", + "version": "0.4", "source": { "type": "git", "url": "https://github.com/joomla-projects/jorobo.git", - "reference": "9d52b9f0d8b6b22f0574e40166fd6ebee479ab56" + "reference": "6f815a48d75418023c4de5cd79a8f1eb7150ee31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/jorobo/zipball/9d52b9f0d8b6b22f0574e40166fd6ebee479ab56", - "reference": "9d52b9f0d8b6b22f0574e40166fd6ebee479ab56", + "url": "https://api.github.com/repos/joomla-projects/jorobo/zipball/6f815a48d75418023c4de5cd79a8f1eb7150ee31", + "reference": "6f815a48d75418023c4de5cd79a8f1eb7150ee31", "shasum": "" }, "require": { @@ -1358,7 +1424,7 @@ } ], "description": "Tools and Tasks based on Robo.li for Joomla Extension Development and Releases", - "time": "2016-03-14 14:51:42" + "time": "2016-04-14 17:32:12" }, { "name": "joomla-projects/robo", @@ -1403,16 +1469,16 @@ }, { "name": "joomla-projects/selenium-server-standalone", - "version": "v2.52.0", + "version": "v2.53.0.1", "source": { "type": "git", "url": "https://github.com/joomla-projects/selenium-server-standalone.git", - "reference": "17b4bb3fd087ded32fe2d9342b8573a75f56460c" + "reference": "4c9428e1450de6a9fa956f3bd726351a9b281b53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/selenium-server-standalone/zipball/17b4bb3fd087ded32fe2d9342b8573a75f56460c", - "reference": "17b4bb3fd087ded32fe2d9342b8573a75f56460c", + "url": "https://api.github.com/repos/joomla-projects/selenium-server-standalone/zipball/4c9428e1450de6a9fa956f3bd726351a9b281b53", + "reference": "4c9428e1450de6a9fa956f3bd726351a9b281b53", "shasum": "" }, "bin": [ @@ -1435,7 +1501,7 @@ "selenium", "testing" ], - "time": "2016-02-16 11:07:51" + "time": "2016-05-30 15:21:57" }, { "name": "joomla/compat", @@ -2839,16 +2905,16 @@ }, { "name": "sebastian/git", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/git.git", - "reference": "38638de3e94830a5cd7a5956135589b967609cd5" + "reference": "607dcc6003502acdd0e6199b60ba954ce00f3004" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/38638de3e94830a5cd7a5956135589b967609cd5", - "reference": "38638de3e94830a5cd7a5956135589b967609cd5", + "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/607dcc6003502acdd0e6199b60ba954ce00f3004", + "reference": "607dcc6003502acdd0e6199b60ba954ce00f3004", "shasum": "" }, "require": { @@ -2880,7 +2946,7 @@ "keywords": [ "git" ], - "time": "2016-02-21 15:02:23" + "time": "2016-03-12 23:31:06" }, { "name": "sebastian/global-state", @@ -3149,16 +3215,16 @@ }, { "name": "symfony/browser-kit", - "version": "v3.0.6", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "e07127ac31230b30887c2dddf3708d883d239b14" + "reference": "b645a9b23d6c0eeba5ac823fa87bf010db9aff22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e07127ac31230b30887c2dddf3708d883d239b14", - "reference": "e07127ac31230b30887c2dddf3708d883d239b14", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b645a9b23d6c0eeba5ac823fa87bf010db9aff22", + "reference": "b645a9b23d6c0eeba5ac823fa87bf010db9aff22", "shasum": "" }, "require": { @@ -3175,7 +3241,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3202,7 +3268,7 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-03-04 07:56:56" }, { "name": "symfony/config", @@ -3319,16 +3385,16 @@ }, { "name": "symfony/css-selector", - "version": "v3.0.6", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0" + "reference": "e17f386efef7258ac671c24e727673abd086b0cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/65e764f404685f2dc20c057e889b3ad04b2e2db0", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/e17f386efef7258ac671c24e727673abd086b0cf", + "reference": "e17f386efef7258ac671c24e727673abd086b0cf", "shasum": "" }, "require": { @@ -3337,7 +3403,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3368,7 +3434,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-03-04 07:56:56" }, { "name": "symfony/dependency-injection", @@ -3435,16 +3501,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.0.6", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "49b588841225b205700e5122fa01911cabada857" + "reference": "12aa63fd41b060d2bee9a34623d29eda70bc8fe3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/49b588841225b205700e5122fa01911cabada857", - "reference": "49b588841225b205700e5122fa01911cabada857", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/12aa63fd41b060d2bee9a34623d29eda70bc8fe3", + "reference": "12aa63fd41b060d2bee9a34623d29eda70bc8fe3", "shasum": "" }, "require": { @@ -3460,7 +3526,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3487,7 +3553,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2016-04-12 18:09:53" + "time": "2016-05-13 15:49:09" }, { "name": "symfony/event-dispatcher", @@ -3813,16 +3879,16 @@ }, { "name": "symfony/yaml", - "version": "v3.0.6", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0047c8366744a16de7516622c5b7355336afae96" + "reference": "eca51b7b65eb9be6af88ad7cc91685f1556f5c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", - "reference": "0047c8366744a16de7516622c5b7355336afae96", + "url": "https://api.github.com/repos/symfony/yaml/zipball/eca51b7b65eb9be6af88ad7cc91685f1556f5c9a", + "reference": "eca51b7b65eb9be6af88ad7cc91685f1556f5c9a", "shasum": "" }, "require": { @@ -3831,7 +3897,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3858,7 +3924,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-05-26 21:46:24" }, { "name": "theseer/fdomdocument", @@ -3902,16 +3968,16 @@ }, { "name": "twig/twig", - "version": "v1.24.0", + "version": "v1.24.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8" + "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8", - "reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512", + "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512", "shasum": "" }, "require": { @@ -3959,7 +4025,7 @@ "keywords": [ "templating" ], - "time": "2016-01-25 21:22:18" + "time": "2016-05-30 09:11:59" } ], "aliases": [], From 9fb8d3e6fb42d9d3025600dc2cc7b80c163fb304 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Wed, 22 Jun 2016 14:55:45 +0200 Subject: [PATCH 08/40] Update Smart search tests --- tests/_support/Step/Acceptance/weblink.php | 31 ++++ .../AdministratorSmartSearchCest.php | 132 ++++++++++-------- 2 files changed, 108 insertions(+), 55 deletions(-) diff --git a/tests/_support/Step/Acceptance/weblink.php b/tests/_support/Step/Acceptance/weblink.php index c28b2a4..075e789 100644 --- a/tests/_support/Step/Acceptance/weblink.php +++ b/tests/_support/Step/Acceptance/weblink.php @@ -44,4 +44,35 @@ class weblink extends \AcceptanceTester $I->clickToolbarButton('Save & Close'); $I->waitForText('Web link successfully saved', '30', ['id' => 'system-message-container']); } + + public function administratorDeleteWeblink($title) + { + $I = $this; + + $I->amGoingTo('Navigate to Weblinks page in /administrator/'); + $I->amOnPage('administrator/index.php?option=com_weblinks'); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->expectTo('see weblinks page'); + + $I->amGoingTo('Search for the weblink'); + $I->searchForItem($title); + $I->waitForText('Web Links','30',['css' => 'h1']); + + $I->amGoingTo('Trash the weblink'); + $I->checkAllResults(); + $I->clickToolbarButton('Trash'); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->waitForText('Web link successfully trashed', 30, ['id' => 'system-message-container']); + + $I->amGoingTo('Delete the weblink'); + $I->selectOptionInChosen('- Select Status -', 'Trashed'); + $I->amGoingTo('Search the just saved weblink'); + $I->searchForItem($title); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->checkAllResults(); + $I->click(['xpath'=> '//div[@id="toolbar-delete"]/button']); + $I->acceptPopup(); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->waitForText('1 web link successfully deleted.', 30, ['id' => 'system-message-container']); + } } \ No newline at end of file diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php index 1edc734..175b324 100644 --- a/tests/acceptance/administrator/AdministratorSmartSearchCest.php +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -12,13 +12,13 @@ class AdministratorSmartSearchCest public function __construct() { $this->faker = Faker\Factory::create(); - $this->title = 'SmartSearch' . $this->faker->randomNumber(); + $this->title = $this->faker->bothify('SmartSearch ?##?'); + $this->url = $this->faker->url; $this->articletext = 'This is a test'; } - /* - * Before the tests proper, switch the WYSIWYG editor off. - * This is to make it easier to create test content. + /** + * Before the tests proper, switch the WYSIWYG editor off. This is to make it easier to create test content. */ public function administratorDisableEditor(\Step\Acceptance\weblink $I) { @@ -27,7 +27,7 @@ class AdministratorSmartSearchCest $I->doAdministratorLogin(); - $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the plugin'); + $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the WYSIWYG Editor'); $I->amOnPage('administrator/index.php?option=com_config'); $I->waitForText('Global Configuration', 30, ['class' => 'page-title']); $I->selectOptionInChosen('Default Editor', 'Editor - None'); @@ -37,29 +37,46 @@ class AdministratorSmartSearchCest $I->see('Configuration successfully saved', ['id' => 'system-message-container']); } - /* - * Before the tests proper, the Smart Search content plugin must be enabled. - */ public function administratorEnableContentPlugin(\Step\Acceptance\weblink $I) { $I->am('Administrator'); - $I->wantToTest('Enabling the Smart Search content plugin before the tests proper'); + $I->wantToTest('Enabling the Smart Search content plugin. Note that this is not a requirement for Smart Search to index Weblinks'); $I->doAdministratorLogin(); $I->amGoingTo('Navigate to the Smart Search page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_finder'); $I->expectTo('see a message saying that the content plugin should be enabled'); - $I->waitForElement(['link' => 'enable this plugin']); - $I->click(['link' => 'enable this plugin']); - $I->waitForText('Plugins', 30, ['class'=> 'page-title']); - $I->waitForElement(['link' => 'Content - Smart Search']); - $I->checkOption(['id' => 'cb0']); - $I->clickToolbarButton('Publish'); // Note: The button is called "Enable", but we need to call it "Publish" here. - $I->waitForText('Plugin successfully enabled', 30, ['class' => 'alert-message']); + $I->waitForElement(['link' => 'Smart Search Content Plugin']); + $I->click(['link' => 'Smart Search Content Plugin']); + $I->waitForText('Plugins: Content - Smart Search', 30, ['class'=> 'page-title']); + $I->selectOptionInChosen('Status', 'Enabled'); + $I->clickToolbarButton('save & close'); + $I->waitForText('Plugin successfully saved.', 30, ['id' => 'system-message-container']); + $I->see('Plugin successfully saved.', ['id' => 'system-message-container']); } - /* + /** + * Before the tests proper, the Weblinks Smart Search plugin must be enabled. + */ + public function administratorEnableSmartsearchWeblinksPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Enabling the Smart Search Weblinks plugin'); + + $I->doAdministratorLogin(); + + $I->amOnPage('administrator/index.php?option=com_plugins'); + $I->searchForItem('Smart Search - Web Links'); + $I->click(['link' => 'Smart Search - Web Links']); + $I->waitForText('Plugins: Smart Search - Web Links', 30, ['class'=> 'page-title']); + $I->selectOptionInChosen('Status', 'Enabled'); + $I->clickToolbarButton('save & close'); + $I->waitForText('Plugin successfully saved.', 30, ['id' => 'system-message-container']); + $I->see('Plugin successfully saved.', ['id' => 'system-message-container']); + } + + /** * Purge the index. */ public function administratorPurgeIndex(\Step\Acceptance\weblink $I) @@ -72,12 +89,21 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to the Smart Search page in /administrator/ and purge the index'); $I->amOnPage('administrator/index.php?option=com_finder'); $I->waitForText('Smart Search', 30, ['class'=> 'page-title']); - $I->clickToolbarButton('Trash'); // Note: The button is called "Clear Index", but we need to call it "Trash" here. + + $I->click('Clear Index'); $I->acceptPopup(); $I->waitForText('All items have been successfully deleted', 30, ['class' => 'alert-message']); + $I->see('All items have been successfully deleted', ['class' => 'alert-message']); } - /* + public function administratorCreateWeblink(\Step\Acceptance\weblink $I) + { + $I->doAdministratorLogin(); + + $I->createWeblink($this->title, $this->url); + } + + /** * Index the current content. */ public function administratorRunTheIndexer(\Step\Acceptance\weblink $I) @@ -90,43 +116,13 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to Smart Search page in /administrator/ and index the content'); $I->amOnPage('administrator/index.php?option=com_finder'); $I->waitForText('Smart Search: Indexed Content', 30, ['class'=> 'page-title']); - $I->click(['css' => 'button[data-target="#modal-archive"]']); - $I->wait(1); - $I->switchToIFrame('Smart Search Indexer'); - $I->checkForPhpNoticesOrWarnings(); - - // Put something here to check that it worked. + $I->click(['xpath' => "//div[@id='toolbar']//button[contains(text()[normalize-space()], 'Index')]"]); + $I->comment('I wait while smart search indexes the links'); + $I->wait(2); + $I->waitForText($this->title, 30, '#j-main-container'); } - /* - * Add a new article. - * Since the content plugin is enabled, this will add the article to the search index. - * - * @todo Revisit this when Gherkin is available. - */ - public function administratorAddNewArticle(\Step\Acceptance\weblink $I) - { - $I->am('Administrator'); - $I->wantToTest('Adding a new article before the tests proper'); - - $I->doAdministratorLogin(); - - $I->amGoingTo('Navigate to the Article Manager Edit page in /administrator/ and create a new article'); - $I->amOnPage('administrator/index.php?option=com_content'); - $I->waitForText('Articles', 30, ['class'=> 'page-title']); - $I->clickToolbarButton('New'); - $I->waitForText('Articles: New', 30, ['class'=> 'page-title']); - - $I->fillField(['id' => 'jform_title'], $this->title); - $I->fillField(['id' => 'jform_articletext'], $this->articletext); - $I->clickToolbarButton('Save & Close'); - $I->waitForText('Articles', 30, ['class'=> 'page-title']); - $I->expectTo('see a success message and the article added after saving it'); - $I->see('Article successfully saved', ['id' => 'system-message-container']); - $I->see($this->title, ['id' => 'articleList']); - } - - /* + /** * After the tests, the Smart Search content plugin must be disabled, ready for the next test. */ public function administratorDisableContentPlugin(\Step\Acceptance\weblink $I) @@ -145,5 +141,31 @@ class AdministratorSmartSearchCest $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. $I->waitForText('Plugin successfully disabled', 30, ['class' => 'alert-message']); } -} + /** + * After the tests, the Smart Search content plugin must be disabled, ready for the next test. + */ + public function administratorDisableSmartsearchWeblinksPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Disabling the Smart Search content plugin, ready for the next test run'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Plugins page in /administrator/ and disable the Smart Search Content plugin'); + $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins'); + $I->searchForItem('Smart Search - Web Links'); + $I->waitForText('Plugins', 30, ['class'=> 'page-title']); + $I->waitForElement(['link' => 'Smart Search - Web Links']); + $I->checkOption(['id' => 'cb0']); + $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. + $I->waitForText('Plugin successfully disabled', 30, ['class' => 'alert-message']); + } + + public function cleanUp(\Step\Acceptance\weblink $I) + { + $I->doAdministratorLogin(); + + $I->administratorDeleteWeblink($this->title); + } +} From 5bc5e45624c31af7ead2439642aee4b637247b60 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Wed, 22 Jun 2016 15:02:33 +0200 Subject: [PATCH 09/40] Fix delete message --- tests/_support/Step/Acceptance/weblink.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_support/Step/Acceptance/weblink.php b/tests/_support/Step/Acceptance/weblink.php index 075e789..e7bed69 100644 --- a/tests/_support/Step/Acceptance/weblink.php +++ b/tests/_support/Step/Acceptance/weblink.php @@ -62,7 +62,7 @@ class weblink extends \AcceptanceTester $I->checkAllResults(); $I->clickToolbarButton('Trash'); $I->waitForText('Web Links','30',['css' => 'h1']); - $I->waitForText('Web link successfully trashed', 30, ['id' => 'system-message-container']); + $I->waitForText('1 web link successfully trashed', 30, ['id' => 'system-message-container']); $I->amGoingTo('Delete the weblink'); $I->selectOptionInChosen('- Select Status -', 'Trashed'); From d840a7f50bfffc6a501c8a53acca1720c4e42af0 Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Sat, 25 Jun 2016 21:10:22 +0100 Subject: [PATCH 10/40] Convert remaining "Weblinks" text to "Web Links" (#210) * "Weblink" to "Web Link" (frontend module) * "Weblink" to "Web Link" (package language) * update site name * admin language * admin language 2 * missing this one * change text also in tests * forgot one * change frontend tests too --- .../language/en-GB/en-GB.com_weblinks.ini | 2 +- .../language/en-GB/en-GB.com_weblinks.sys.ini | 2 +- src/language/en-GB/en-GB.mod_weblinks.ini | 2 +- src/language/en-GB/en-GB.pkg_weblinks.sys.ini | 4 +-- src/pkg_weblinks.xml | 2 +- .../AdministratorCategoriesCest.php | 30 +++++++++---------- .../frontend/FrontendWeblinksCest.php | 28 ++++++++--------- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/administrator/language/en-GB/en-GB.com_weblinks.ini b/src/administrator/language/en-GB/en-GB.com_weblinks.ini index 1606b03..77b0c66 100644 --- a/src/administrator/language/en-GB/en-GB.com_weblinks.ini +++ b/src/administrator/language/en-GB/en-GB.com_weblinks.ini @@ -3,7 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -COM_WEBLINKS="Weblinks" +COM_WEBLINKS="Web Links" COM_WEBLINKS_ACCESS_HEADING="Access" COM_WEBLINKS_BATCH_OPTIONS="Batch process the selected links" COM_WEBLINKS_BATCH_TIP="If a category is selected for move/copy, any actions selected will be applied to the copied or moved links. Otherwise, all actions are applied to the selected links." diff --git a/src/administrator/language/en-GB/en-GB.com_weblinks.sys.ini b/src/administrator/language/en-GB/en-GB.com_weblinks.sys.ini index 422a292..f3224f8 100644 --- a/src/administrator/language/en-GB/en-GB.com_weblinks.sys.ini +++ b/src/administrator/language/en-GB/en-GB.com_weblinks.sys.ini @@ -3,7 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -COM_WEBLINKS="Weblinks" +COM_WEBLINKS="Web Links" COM_WEBLINKS_CATEGORIES="Categories" COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_DESC="Show all the web link categories within a category." COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_OPTION="Default" diff --git a/src/language/en-GB/en-GB.mod_weblinks.ini b/src/language/en-GB/en-GB.mod_weblinks.ini index c45906c..6e5588a 100644 --- a/src/language/en-GB/en-GB.mod_weblinks.ini +++ b/src/language/en-GB/en-GB.mod_weblinks.ini @@ -3,7 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 - No BOM -MOD_WEBLINKS="Weblinks" +MOD_WEBLINKS="Web Links" MOD_WEBLINKS_FIELD_CATEGORY_DESC="Choose the Web Links category to display." MOD_WEBLINKS_FIELD_COUNT_DESC="Number of Web Links to display." MOD_WEBLINKS_FIELD_COUNT_LABEL="Count" diff --git a/src/language/en-GB/en-GB.pkg_weblinks.sys.ini b/src/language/en-GB/en-GB.pkg_weblinks.sys.ini index c82708d..280b929 100644 --- a/src/language/en-GB/en-GB.pkg_weblinks.sys.ini +++ b/src/language/en-GB/en-GB.pkg_weblinks.sys.ini @@ -3,5 +3,5 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -PKG_WEBLINKS="Weblinks Extension Package" -PKG_WEBLINKS_XML_DESCRIPTION="The Weblinks package includes the weblinks component, module, and search plugins for both of Joomla's search platforms." +PKG_WEBLINKS="Web Links Extension Package" +PKG_WEBLINKS_XML_DESCRIPTION="The Web Links package includes the Web Links component, module, and search plugins for both of Joomla's search platforms." diff --git a/src/pkg_weblinks.xml b/src/pkg_weblinks.xml index e1d6700..51b6265 100644 --- a/src/pkg_weblinks.xml +++ b/src/pkg_weblinks.xml @@ -25,6 +25,6 @@ - https://raw.githubusercontent.com/joomla-extensions/weblinks/master/manifest.xml + https://raw.githubusercontent.com/joomla-extensions/weblinks/master/manifest.xml diff --git a/tests/acceptance/administrator/AdministratorCategoriesCest.php b/tests/acceptance/administrator/AdministratorCategoriesCest.php index 4857fd9..9d583ff 100644 --- a/tests/acceptance/administrator/AdministratorCategoriesCest.php +++ b/tests/acceptance/administrator/AdministratorCategoriesCest.php @@ -32,12 +32,12 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']); + $I->waitForText('Web Links: Categories', '60', ['css' => 'h1']); $I->expectTo('see categories page'); $I->amGoingTo('try to save a category with empty title and it should fail'); $I->clickToolbarButton('new'); - $I->waitForText('Weblinks: New Category', '60', ['css' => 'h1']); + $I->waitForText('Web Links: New Category', '60', ['css' => 'h1']); $I->clickToolbarButton('save'); $I->expectTo('see an error when trying to save a category without title'); $I->see('Invalid field: Title', ['id' => 'system-message-container']); @@ -52,13 +52,13 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/ and create a Category'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']); + $I->waitForText('Web Links: Categories', '60', ['css' => 'h1']); $I->expectTo('see categories page'); $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a category with a filled title'); $I->clickToolbarButton('New'); - $I->waitForText('Weblinks: New Category', '60', ['css' => 'h1']); + $I->waitForText('Web Links: New Category', '60', ['css' => 'h1']); $I->fillField(['id' => 'jform_title'], $this->categoryTitle); $I->clickToolbarButton('Save & Close'); $I->expectTo('see a success message after saving the category'); @@ -78,9 +78,9 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); $I->searchForItem($this->categoryTitle); - $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']); + $I->waitForText('Web Links: Categories', '60', ['css' => 'h1']); $I->checkAllResults(); - $I->amGoingTo('try to publish a Weblinks Category'); + $I->amGoingTo('try to publish a Web Links Category'); $I->clickToolbarButton('publish'); $I->waitForElement(['id' => 'system-message-container'], '60'); $I->expectTo('see a success message after publishing the category'); @@ -98,10 +98,10 @@ class AdministratorCategoriesCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']); + $I->waitForText('Web Links: Categories', '60', ['css' => 'h1']); $I->searchForItem($this->categoryTitle); $I->checkAllResults(); - $I->amGoingTo('try to unpublish a Weblinks Category'); + $I->amGoingTo('try to unpublish a Web Links Category'); $I->clickToolbarButton('unpublish'); $I->waitForElement(['id' => 'system-message-container'], '60'); $I->expectTo('See a success message after unpublishing the category'); @@ -119,10 +119,10 @@ class AdministratorCategoriesCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']); + $I->waitForText('Web Links: Categories', '60', ['css' => 'h1']); $I->searchForItem($this->categoryTitle); $I->checkAllResults(); - $I->amGoingTo('try to archive a weblink category'); + $I->amGoingTo('try to archive a Web Links category'); $I->clickToolbarButton('archive'); $I->waitForElement(['id' => 'system-message-container'], '60'); $I->expectTo('see a success message after Archiving the category'); @@ -140,11 +140,11 @@ class AdministratorCategoriesCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']); + $I->waitForText('Web Links: Categories', '60', ['css' => 'h1']); $I->setFilter('Select Status', 'Archived'); $I->searchForItem($this->categoryTitle); $I->checkAllResults(); - $I->amGoingTo('try to delete a Weblinks Category'); + $I->amGoingTo('try to delete a Web Links Category'); $I->clickToolbarButton('Trash'); $I->waitForElement(['id' => 'system-message-container'], '60'); $I->expectTo('see a success message after Trashing the category'); @@ -162,11 +162,11 @@ class AdministratorCategoriesCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']); + $I->waitForText('Web Links: Categories', '60', ['css' => 'h1']); $I->setFilter('Select Status', 'Trashed'); $I->searchForItem($this->categoryTitle); $I->checkAllResults(); - $I->amGoingTo('try to delete a Weblinks Category'); + $I->amGoingTo('try to delete a Web Links Category'); $I->clickToolbarButton('Empty trash'); $I->acceptPopup(); $I->waitForElement(['id' => 'system-message-container'], '60'); @@ -184,7 +184,7 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/ and verify the Tabs'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); $I->clickToolbarButton('New'); - $I->waitForText('Weblinks: New Category', '30', ['css' => 'h1']); + $I->waitForText('Web Links: New Category', '30', ['css' => 'h1']); $I->verifyAvailableTabs(['Category', 'Publishing', 'Permissions', 'Options']); } } diff --git a/tests/acceptance/frontend/FrontendWeblinksCest.php b/tests/acceptance/frontend/FrontendWeblinksCest.php index e8ceb1c..46c48aa 100644 --- a/tests/acceptance/frontend/FrontendWeblinksCest.php +++ b/tests/acceptance/frontend/FrontendWeblinksCest.php @@ -28,26 +28,26 @@ class FrontendWeblinksCest public function createWeblinkAndConfirmFrontend(\Step\Acceptance\weblink $I) { $I->am('Administrator'); - $I->wantToTest('Listing a category of Weblinks in frontend'); + $I->wantToTest('Listing a category of Web Links in frontend'); $I->doAdministratorLogin(); $I->createWeblink($this->title, $this->url, "No"); // Menu link - $I->createMenuItem($this->menuItem, 'Weblinks', 'List All Web Link Categories', 'Main Menu'); + $I->createMenuItem($this->menuItem, 'Web Links', 'List All Web Link Categories', 'Main Menu'); // Go to the frontend $I->comment('I want to check if the menu entry exists in the frontend'); $I->amOnPage('index.php?option=com_weblinks'); - $I->expectTo('see weblink categories'); + $I->expectTo('see web link categories'); $I->waitForText('Uncategorised','30', ['css' => 'h3']); $I->checkForPhpNoticesOrWarnings(); - $I->comment('I open the uncategorised Weblink Category'); + $I->comment('I open the uncategorised Web link Category'); $I->click(['link' => 'Uncategorised']); $I->waitForText('Uncategorised','30', ['css' => 'h2']); - $I->expectTo('see the weblink we created'); + $I->expectTo('see the web link we created'); $I->seeElement(['link' => $this->title]); $I->seeElement(['xpath' => "//a[@href='$this->url']"]); } @@ -66,16 +66,16 @@ class FrontendWeblinksCest // Go to the frontend $I->amOnPage('index.php?option=com_weblinks'); - $I->expectTo('see weblink categories'); + $I->expectTo('see web link categories'); $I->waitForText('Uncategorised','30', ['css' => 'h3']); $I->checkForPhpNoticesOrWarnings(); - $I->comment('I open the uncategorised Weblink Category'); + $I->comment('I open the uncategorised Web Link Category'); $I->waitForElement(['link' => 'Uncategorised'], 60); $I->click(['link' => 'Uncategorised']); // Check that hits is 0 $I->waitForText('Uncategorised','30', ['css' => 'h2']); - $I->expectTo('see the weblink we created'); + $I->expectTo('see the web link we created'); $I->seeElement(['link' => $title]); $I->expectTo('see that hits is 0'); $I->see('Hits: 0', ['class' => 'list-hits']); @@ -86,7 +86,7 @@ class FrontendWeblinksCest $I->amOnPage('index.php?option=com_weblinks'); $I->waitForElement(['link' => 'Uncategorised'], 60); $I->click(['link' => 'Uncategorised']); - $I->comment('I search the weblink: ' . $title); + $I->comment('I search the web link: ' . $title); $I->waitForElement(['id' => 'filter-search'], 60); $I->fillField(['id' => 'filter-search'], $title); $I->pressKey(['id' => 'filter-search'], \Facebook\WebDriver\WebDriverKeys::ENTER); @@ -111,15 +111,15 @@ class FrontendWeblinksCest // Go to the frontend $I->amOnPage('index.php?option=com_weblinks'); - $I->expectTo('see weblink categories'); + $I->expectTo('see web link categories'); $I->waitForText('Uncategorised','30', ['css' => 'h3']); $I->checkForPhpNoticesOrWarnings(); - $I->comment('I open the uncategorised Weblink Category'); + $I->comment('I open the uncategorised Web Link Category'); $I->click(['link' => 'Uncategorised']); // Check that hits is 0 $I->waitForText('Uncategorised','30', ['css' => 'h2']); - $I->expectTo('see the weblink we created'); + $I->expectTo('see the web link we created'); $I->seeElement(['link' => $title]); $I->expectTo('see that hits is 0'); $I->see('Hits: 0', ['class' => 'list-hits']); @@ -127,10 +127,10 @@ class FrontendWeblinksCest // Click on the link, go back, and check that hits is 1 $I->click(['link' => $title]); $I->amOnPage('index.php?option=com_weblinks'); - $I->comment('I open the uncategorised Weblink Category'); + $I->comment('I open the uncategorised Web Link Category'); $I->waitForElement(['link' => 'Uncategorised'], 60); $I->click(['link' => 'Uncategorised']); - $I->comment('I search the weblink: ' . $title); + $I->comment('I search the web link: ' . $title); $I->waitForElement(['id' => 'filter-search'], 60); $I->fillField(['id' => 'filter-search'], $title); $I->pressKey(['id' => 'filter-search'], \Facebook\WebDriver\WebDriverKeys::ENTER); From bf118c40df0edf61214b1c5366fbe6d777fe4897 Mon Sep 17 00:00:00 2001 From: peterpeter Date: Sat, 25 Jun 2016 22:44:10 +0200 Subject: [PATCH 11/40] Fix if 'git' instead of 'git.exe' as command is used on windows (#168) --- RoboFile.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index dd9a76d..c92ada8 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -66,9 +66,17 @@ class RoboFile extends \Robo\Tasks { if ($this->isWindows()) { - return '.exe'; + // check wehter git.exe or git as command should be used, + // as on window both is possible + if(!$this->_exec('git.exe --version')->getMessage()) + { + return ''; + } + else + { + return '.exe'; + } } - return ''; } From 8b6db18948dc130de563ba693773bdb57c06d470 Mon Sep 17 00:00:00 2001 From: Bear Date: Sat, 25 Jun 2016 15:51:02 -0500 Subject: [PATCH 12/40] issue #8891 fixed typo s/$cachable/$cacheable (#179) Thanks @N6REJ --- .../components/com_weblinks/controller.php | 4 ++-- src/components/com_weblinks/controller.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/administrator/components/com_weblinks/controller.php b/src/administrator/components/com_weblinks/controller.php index 50c8d3f..398ec36 100644 --- a/src/administrator/components/com_weblinks/controller.php +++ b/src/administrator/components/com_weblinks/controller.php @@ -19,14 +19,14 @@ class WeblinksController extends JControllerLegacy /** * Method to display a view. * - * @param boolean $cachable If true, the view output will be cached + * @param boolean $cacheable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JControllerLegacy This object to support chaining. * * @since 1.5 */ - public function display($cachable = false, $urlparams = false) + public function display($cacheable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/weblinks.php'; diff --git a/src/components/com_weblinks/controller.php b/src/components/com_weblinks/controller.php index b98080e..1e232da 100644 --- a/src/components/com_weblinks/controller.php +++ b/src/components/com_weblinks/controller.php @@ -19,7 +19,7 @@ class WeblinksController extends JControllerLegacy /** * Method to display a view. * - * @param boolean $cachable If true, the view output will be cached + * @param boolean $cacheable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, * for valid values see {@link JFilterInput::clean()}. * @@ -27,9 +27,9 @@ class WeblinksController extends JControllerLegacy * * @since 1.5 */ - public function display($cachable = false, $urlparams = false) + public function display($cacheable = false, $urlparams = false) { - $cachable = true; // Huh? Why not just put that in the constructor? + $cacheable = true; // Huh? Why not just put that in the constructor? $user = JFactory::getUser(); // Set the default view name and format from the Request. @@ -41,7 +41,7 @@ class WeblinksController extends JControllerLegacy if (JFactory::getUser()->id ||($this->input->getMethod() == 'POST' && $vName = 'categories')) { - $cachable = false; + $cacheable = false; } $safeurlparams = array( @@ -60,6 +60,6 @@ class WeblinksController extends JControllerLegacy return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); } - return parent::display($cachable, $safeurlparams); + return parent::display($cacheable, $safeurlparams); } } From a3f6281bd4915ac7bb21f643a9533864f12995fd Mon Sep 17 00:00:00 2001 From: Prital Patel Date: Sun, 26 Jun 2016 02:39:37 +0530 Subject: [PATCH 13/40] [fix #212] Weblink created date not showed on Search view (#219) Simple fix. Two successful tests. Thanks @pritalpatel --- src/plugins/search/weblinks/weblinks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/search/weblinks/weblinks.php b/src/plugins/search/weblinks/weblinks.php index 1f7a492..16d1d1d 100644 --- a/src/plugins/search/weblinks/weblinks.php +++ b/src/plugins/search/weblinks/weblinks.php @@ -174,7 +174,7 @@ class PlgSearchWeblinks extends JPlugin $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; - $query->select('a.title AS title, \'\' AS created, a.url, a.description AS text, ' . $case_when . "," . $case_when1) + $query->select('a.title AS title, a.created AS created, a.url, a.description AS text, ' . $case_when . "," . $case_when1) ->select($query->concatenate(array($db->quote($searchWeblinks), 'c.title'), " / ") . ' AS section') ->select('\'1\' AS browsernav') ->from('#__weblinks AS a') From 3514f29bda9919ff35dd37c82dc968380f94859d Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 25 Jun 2016 23:22:04 +0200 Subject: [PATCH 14/40] Support issue templates and move contributing (#222) * support issue templates and move contributing * support issue templates and move contributing --- CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 .github/ISSUE_TEMPLATE.md | 18 ++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 5 +++++ 3 files changed, 23 insertions(+) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..722c66c --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,18 @@ +#### Steps to reproduce the issue + + + +#### Expected result + + + +#### Actual result + + + +#### System information (as much as possible) + + + +#### Additional comments + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..2434a62 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +Pull Request for Issue # . + +#### Summary of Changes + +#### Testing Instructions From 0af518e0f39b8f5ab71b5d6f92bc7aa441336da7 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 25 Jun 2016 23:23:16 +0200 Subject: [PATCH 15/40] JArrayHelper => ArrayHelper (#221) * cs and arrayhelper * cs and arrayhelper --- .../com_weblinks/controllers/weblink.php | 11 ++++---- .../com_weblinks/controllers/weblink.php | 8 +++--- .../com_weblinks/models/weblink.php | 26 +++++++++---------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/administrator/components/com_weblinks/controllers/weblink.php b/src/administrator/components/com_weblinks/controllers/weblink.php index 278deea..08b7496 100644 --- a/src/administrator/components/com_weblinks/controllers/weblink.php +++ b/src/administrator/components/com_weblinks/controllers/weblink.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Weblink controller class. * @@ -27,14 +29,13 @@ class WeblinksControllerWeblink extends JControllerForm */ protected function allowAdd($data = array()) { - $user = JFactory::getUser(); - $categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int'); + $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int'); $allow = null; if ($categoryId) { // If the category has been passed in the URL check it. - $allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId); + $allow = JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId); } if ($allow !== null) @@ -104,9 +105,9 @@ class WeblinksControllerWeblink extends JControllerForm * @param JModelLegacy $model The data model object. * @param array $validData The validated data. * - * @return void + * @return void * - * @since 1.6 + * @since 1.6 */ protected function postSaveHook(JModelLegacy $model, $validData = array()) { diff --git a/src/components/com_weblinks/controllers/weblink.php b/src/components/com_weblinks/controllers/weblink.php index 1a24736..5251481 100644 --- a/src/components/com_weblinks/controllers/weblink.php +++ b/src/components/com_weblinks/controllers/weblink.php @@ -69,7 +69,7 @@ class WeblinksControllerWeblink extends JControllerForm */ protected function allowAdd($data = array()) { - $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int'); + $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int'); $allow = null; if ($categoryId) @@ -180,8 +180,8 @@ class WeblinksControllerWeblink extends JControllerForm protected function getRedirectToItemAppend($recordId = null, $urlVar = null) { $append = parent::getRedirectToItemAppend($recordId, $urlVar); - $itemId = $this->input->getInt('Itemid'); - $return = $this->getReturnPage(); + $itemId = $this->input->getInt('Itemid'); + $return = $this->getReturnPage(); if ($itemId) { @@ -264,7 +264,7 @@ class WeblinksControllerWeblink extends JControllerForm } // Check whether item access level allows access. - $groups = JFactory::getUser()->getAuthorisedViewLevels(); + $groups = JFactory::getUser()->getAuthorisedViewLevels(); if (!in_array($link->access, $groups)) { diff --git a/src/components/com_weblinks/models/weblink.php b/src/components/com_weblinks/models/weblink.php index 8c7b57b..38d56ea 100644 --- a/src/components/com_weblinks/models/weblink.php +++ b/src/components/com_weblinks/models/weblink.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); /** @@ -34,11 +36,11 @@ class WeblinksModelWeblink extends JModelItem */ protected function populateState() { - $app = JFactory::getApplication(); - $params = $app->getParams(); + $app = JFactory::getApplication(); + $params = $app->getParams(); // Load the object state. - $id = $app->input->getInt('id'); + $id = $app->input->getInt('id'); $this->setState('weblink.id', $id); // Load the parameters. @@ -79,8 +81,8 @@ class WeblinksModelWeblink extends JModelItem } // Convert the JTable to a clean JObject. - $properties = $table->getProperties(1); - $this->_item = JArrayHelper::toObject($properties, 'JObject'); + $properties = $table->getProperties(1); + $this->_item = ArrayHelper::toObject($properties, 'JObject'); } elseif ($error = $table->getError()) { @@ -94,13 +96,13 @@ class WeblinksModelWeblink extends JModelItem /** * Returns a reference to the a Table object, always creating it. * - * @param type The table type to instantiate - * @param string A prefix for the table class name. Optional. - * @param array Configuration array for model. Optional. + * @param type The table type to instantiate + * @param string A prefix for the table class name. Optional. + * @param array Configuration array for model. Optional. * - * @return JTable A database object + * @return JTable A database object * - * @since 1.6 + * @since 1.6 */ public function getTable($type = 'Weblink', $prefix = 'WeblinksTable', $config = array()) { @@ -121,8 +123,6 @@ class WeblinksModelWeblink extends JModelItem $id = $this->getState('weblink.id'); } - $weblink = $this->getTable('Weblink', 'WeblinksTable'); - - return $weblink->hit($id); + return $this->getTable('Weblink', 'WeblinksTable')->hit($id); } } From 7faa44cdb8bedd7adcef0048a742a7c372a7ce9c Mon Sep 17 00:00:00 2001 From: Yves Hoppe Date: Sun, 26 Jun 2016 21:48:32 +0200 Subject: [PATCH 16/40] Updated jorobo.dist.ini for JoRobo version 0.4 (#225) Merged on review. Thanks @yvesh --- jorobo.dist.ini | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/jorobo.dist.ini b/jorobo.dist.ini index e16b2aa..03307b9 100644 --- a/jorobo.dist.ini +++ b/jorobo.dist.ini @@ -2,3 +2,36 @@ extension = weblinks version = 3.5.0 source = src target = package + +; Create a pre-release of the extension on GitHub +; Add your personal GitHub access tocken +; and add Release to the target (separated by space) above +[github] +remote = origin +branch = develop +token = +owner = joomla-extensions +repository = weblinks +changelog_source = commits + +; Automatic upload of the built extension package to an FTP server +[ftp] +host = +port = 21 +user = +password = +ssl = false +target = / + +; Adds / replaces copyright headers at the beginning of files in the source folder +[header] +files = php,js +exclude = +text = " +/** + * @package Weblinks + * + * @copyright Copyright (C) 2005 - ##YEAR## Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ +" \ No newline at end of file From d353ec98335af6c854059bdaab586ac7d5d456de Mon Sep 17 00:00:00 2001 From: Yves Hoppe Date: Mon, 27 Jun 2016 21:55:16 +0200 Subject: [PATCH 17/40] Running phpcs check with travis on php 5.6 --- .travis.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 47a2b1c..dee7ab3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,23 @@ language: php -php: -- 5.5 -- 5.6 -- 7.0 -addons: - firefox: "46.0.1" + +env: + global: + - RUN_PHPCS="no" + matrix: - allow_failures: + fast_finish: true + include: + - php: 5.5 + - php: 5.6 + env: RUN_PHPCS="yes" + - php: 7.0 + sudo: true + addons: + firefox: "46.0.1" + allow_failures: - php: 7.0 + + before_script: - sudo apt-get update -qq - sudo apt-get install -y --force-yes apache2 libapache2-mod-fastcgi php5-curl php5-mysql php5-intl php5-gd > /dev/null @@ -42,5 +52,8 @@ script: # Build - mv jorobo.dist.ini jorobo.ini - vendor/bin/robo build +# System tests (Codeception) - mv tests/acceptance.suite.dist.yml tests/acceptance.suite.yml - vendor/bin/robo run:tests --use-htaccess +# Run phpcs on PHP 5.6 against weblinks source +- if [[ $RUN_PHPCS == "yes" ]]; then vendor/bin/phpcs --report=full --extensions=php -p --standard=tests/joomla-cms3/build/phpcs/Joomla ./src; fi From cff91ba2448b818f2296fc5db92afe64b9657035 Mon Sep 17 00:00:00 2001 From: Emanuele Reggi Date: Tue, 28 Jun 2016 10:59:52 +0200 Subject: [PATCH 18/40] Group by subcategories on mod_weblinks (#38) * Group by subcategories on mod_weblinks * BUGFIX: added missing 1-column option. * GroupBySubcategories turned Off by default. * Improved readability of inline php statements. --- .../com_weblinks/models/category.php | 27 +- src/language/en-GB/en-GB.mod_weblinks.ini | 10 + src/modules/mod_weblinks/helper.php | 3 + src/modules/mod_weblinks/mod_weblinks.xml | 253 +++++++++++------- src/modules/mod_weblinks/tmpl/default.php | 151 ++++++++--- 5 files changed, 307 insertions(+), 137 deletions(-) diff --git a/src/components/com_weblinks/models/category.php b/src/components/com_weblinks/models/category.php index d145e8c..b7658cc 100644 --- a/src/components/com_weblinks/models/category.php +++ b/src/components/com_weblinks/models/category.php @@ -121,9 +121,20 @@ class WeblinksModelCategory extends JModelList // Filter by category. if ($categoryId = $this->getState('category.id')) { - $query->where('a.catid = ' . (int) $categoryId) - ->join('LEFT', '#__categories AS c ON c.id = a.catid') - ->where('c.access IN (' . $groups . ')'); + // Group by subcategory + if($this->getState('category.group', 0)) + { + $query->select('c.title AS category_title') + ->where('c.parent_id = ' . (int) $categoryId) + ->join('LEFT', '#__categories AS c ON c.id = a.catid') + ->where('c.access IN (' . $groups . ')'); + } + else + { + $query->where('a.catid = ' . (int) $categoryId) + ->join('LEFT', '#__categories AS c ON c.id = a.catid') + ->where('c.access IN (' . $groups . ')'); + } // Filter by published category $cpublished = $this->getState('filter.c.published'); @@ -176,6 +187,16 @@ class WeblinksModelCategory extends JModelList $search = $db->quote('%' . $db->escape($search, true) . '%'); $query->where('(a.title LIKE ' . $search . ')'); } + + // If grouping by subcategory, add the subcategory list ordering clause. + if($this->getState('category.group', 0)) + { + $query->order( + $db->escape( + $this->getState('category.ordering', 'c.lft')) . ' ' . $db->escape($this->getState('category.direction', 'ASC') + ) + ); + } // Add the list ordering clause. $query->order( diff --git a/src/language/en-GB/en-GB.mod_weblinks.ini b/src/language/en-GB/en-GB.mod_weblinks.ini index 6e5588a..604433d 100644 --- a/src/language/en-GB/en-GB.mod_weblinks.ini +++ b/src/language/en-GB/en-GB.mod_weblinks.ini @@ -5,6 +5,16 @@ MOD_WEBLINKS="Web Links" MOD_WEBLINKS_FIELD_CATEGORY_DESC="Choose the Web Links category to display." +MOD_WEBLINKS_FIELD_GROUPBY_DESC="If set to yes, weblinks will be grouped by subcategories." +MOD_WEBLINKS_FIELD_GROUPBY_LABEL="Group By Subcategories" +MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC="If set to yes, will show groups titles (valid only if grouping)." +MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL="Show Group Title" +MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC="Ordering for the subcategories (valid only if grouping)." +MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL="Group Ordering" +MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC="Direction for the subcategories (valid only if grouping)." +MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL="Group Ordering Direction" +MOD_WEBLINKS_FIELD_COLUMNS_DESC="When grouping by subcategories, split into # columns." +MOD_WEBLINKS_FIELD_COLUMNS_LABEL="Columns" MOD_WEBLINKS_FIELD_COUNT_DESC="Number of Web Links to display." MOD_WEBLINKS_FIELD_COUNT_LABEL="Count" MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded." diff --git a/src/modules/mod_weblinks/helper.php b/src/modules/mod_weblinks/helper.php index 11c031b..7dee5dd 100644 --- a/src/modules/mod_weblinks/helper.php +++ b/src/modules/mod_weblinks/helper.php @@ -57,6 +57,9 @@ class ModWeblinksHelper $catid = (int) $params->get('catid', 0); $model->setState('category.id', $catid); + $model->setState('category.group', $params->get('groupby', 0)); + $model->setState('category.ordering', $params->get('groupby_ordering', 'c.lft')); + $model->setState('category.direction', $params->get('groupby_direction', 'ASC')); // Create query object $db = JFactory::getDbo(); diff --git a/src/modules/mod_weblinks/mod_weblinks.xml b/src/modules/mod_weblinks/mod_weblinks.xml index 1fa8a84..644f488 100644 --- a/src/modules/mod_weblinks/mod_weblinks.xml +++ b/src/modules/mod_weblinks/mod_weblinks.xml @@ -20,141 +20,204 @@
+ name="catid" + type="category" + extension="com_weblinks" + required="true" + label="JCATEGORY" + description="MOD_WEBLINKS_FIELD_CATEGORY_DESC" /> - + name="groupby" + type="radio" + class="btn-group btn-group-yesno" + default="0" + label="MOD_WEBLINKS_FIELD_GROUPBY_LABEL" + description="MOD_WEBLINKS_FIELD_GROUPBY_DESC"> + value="1">JYES - + value="0">JNO + name="groupby_showtitle" + type="radio" + class="btn-group btn-group-yesno" + default="1" + label="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL" + description="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC"> + value="1">JYES + value="0">JNO + name="groupby_ordering" + type="list" + default="c.lft" + label="MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL" + description="MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC"> + value="c.title">JGLOBAL_TITLE - + value="c.lft">MOD_WEBLINKS_FIELD_VALUE_ORDER + name="groupby_direction" + type="list" + default="asc" + label="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL" + description="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC"> + value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING + value="desc">MOD_WEBLINKS_FIELD_VALUE_DESCENDING + name="groupby_columns" + type="list" + default="3" + label="MOD_WEBLINKS_FIELD_COLUMNS_LABEL" + description="MOD_WEBLINKS_FIELD_COLUMNS_DESC"> + value="1">1 + + value="3">3 + + + name="count" + type="text" + default="5" + label="MOD_WEBLINKS_FIELD_COUNT_LABEL" + description="MOD_WEBLINKS_FIELD_COUNT_DESC" /> + + value="title">JGLOBAL_TITLE + value="order">MOD_WEBLINKS_FIELD_VALUE_ORDER + + + + + + + + + + + + + + + + + + + + + + + name="count_clicks" + type="list" + class="chzn-color" + default="0" + label="MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL" + description="MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC"> + + value="0">JNO - + value="1">JYES
+ name="advanced"> + name="layout" + type="modulelayout" + label="JFIELD_ALT_LAYOUT_LABEL" + description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> + name="moduleclass_sfx" + type="textarea" rows="3" + label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" + description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> + name="cache" + type="list" + default="1" + label="COM_MODULES_FIELD_CACHING_LABEL" + description="COM_MODULES_FIELD_CACHING_DESC"> + value="1">JGLOBAL_USE_GLOBAL + value="0">COM_MODULES_FIELD_VALUE_NOCACHING + name="cache_time" + type="text" + default="900" + label="COM_MODULES_FIELD_CACHE_TIME_LABEL" + description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> + name="cachemode" + type="hidden" + default="static"> + value="static">
diff --git a/src/modules/mod_weblinks/tmpl/default.php b/src/modules/mod_weblinks/tmpl/default.php index 52c7ad5..3342cb0 100644 --- a/src/modules/mod_weblinks/tmpl/default.php +++ b/src/modules/mod_weblinks/tmpl/default.php @@ -9,47 +9,120 @@ defined('_JEXEC') or die; ?> -
    - -
  • - link; +get('groupby', 0)) : - switch ($params->get('target', 3)) - { - case 1: - // Open in a new window - echo '' . - htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . ''; - break; + $cats = array(); + $cols = $params->get('groupby_columns', 3); - case 2: - // Open in a popup window - echo "" . - htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . ''; - break; + foreach ($list as $l) + $cats[] = array('catid' => $l->catid, 'title' => $l->category_title); - default: - // Open in parent window - echo '' . - htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . ''; - break; - } + $cats = array_values(array_map('unserialize', array_unique(array_map('serialize', $cats)))); - if ($params->get('description', 0)) - { - echo nl2br($item->description); - } + foreach ($cats as $k => $cat) : - if ($params->get('hits', 0)) - { - echo '(' . $item->hits . ' ' . JText::_('MOD_WEBLINKS_HITS') . ')'; - } - ?> -
  • - -
+ $items = array(); + + foreach ($list as $item) + if ($item->catid == $cat['catid']) + $items[] = $item; +?> + 1) : ?> + +
+ +
+ + get('groupby_showtitle', 1)) : ?> +

+ + + 1) : ?> +
+ +
+ + + + + + From 258f337d596f291faf50bc45f53e23346a54f531 Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Tue, 28 Jun 2016 10:45:18 +0100 Subject: [PATCH 19/40] Implements searchtools, filters, dropdown actions and counting (#208) * implements searchtools, filters and merge the other two PR * just to force travis to run * revert * filter is published * filter is published 2 * modify filter test thanks to yvesh * code style * elseif , not else if --- .../com_weblinks/helpers/weblinks.php | 53 +++++++++ .../models/forms/filter_weblinks.xml | 106 +++++++++++++++++ .../com_weblinks/models/weblinks.php | 88 +++++++------- .../views/weblinks/tmpl/default.php | 109 ++++++------------ .../views/weblinks/tmpl/default_batch.php | 2 +- .../com_weblinks/views/weblinks/view.html.php | 43 +------ .../language/en-GB/en-GB.com_weblinks.ini | 2 + .../AdministratorWeblinksCest.php | 4 +- 8 files changed, 252 insertions(+), 155 deletions(-) create mode 100644 src/administrator/components/com_weblinks/models/forms/filter_weblinks.xml diff --git a/src/administrator/components/com_weblinks/helpers/weblinks.php b/src/administrator/components/com_weblinks/helpers/weblinks.php index 97da0bf..449754c 100644 --- a/src/administrator/components/com_weblinks/helpers/weblinks.php +++ b/src/administrator/components/com_weblinks/helpers/weblinks.php @@ -39,4 +39,57 @@ class WeblinksHelper extends JHelperContent $vName == 'categories' ); } + + /** + * Adds Count Items for WebLinks Category Manager. + * + * @param stdClass[] &$items The weblinks category objects. + * + * @return stdClass[] The weblinks category objects. + * + * @since 3.6.0 + */ + public static function countItems(&$items) + { + $db = JFactory::getDbo(); + + foreach ($items as $item) + { + $item->count_trashed = 0; + $item->count_archived = 0; + $item->count_unpublished = 0; + $item->count_published = 0; + + $query = $db->getQuery(true) + ->select('state, COUNT(*) AS count') + ->from($db->qn('#__weblinks')) + ->where($db->qn('catid') . ' = ' . (int) $item->id) + ->group('state'); + + $db->setQuery($query); + $weblinks = $db->loadObjectList(); + + foreach ($weblinks as $weblink) + { + if ($weblink->state == 1) + { + $item->count_published = $weblink->count; + } + elseif ($weblink->state == 0) + { + $item->count_unpublished = $weblink->count; + } + elseif ($weblink->state == 2) + { + $item->count_archived = $weblink->count; + } + elseif ($weblink->state == -2) + { + $item->count_trashed = $weblink->count; + } + } + } + + return $items; + } } diff --git a/src/administrator/components/com_weblinks/models/forms/filter_weblinks.xml b/src/administrator/components/com_weblinks/models/forms/filter_weblinks.xml new file mode 100644 index 0000000..0a09af3 --- /dev/null +++ b/src/administrator/components/com_weblinks/models/forms/filter_weblinks.xml @@ -0,0 +1,106 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/administrator/components/com_weblinks/models/weblinks.php b/src/administrator/components/com_weblinks/models/weblinks.php index 50c8eb2..86829d9 100644 --- a/src/administrator/components/com_weblinks/models/weblinks.php +++ b/src/administrator/components/com_weblinks/models/weblinks.php @@ -34,18 +34,23 @@ class WeblinksModelWeblinks extends JModelList 'alias', 'a.alias', 'checked_out', 'a.checked_out', 'checked_out_time', 'a.checked_out_time', - 'catid', 'a.catid', 'category_title', - 'state', 'a.state', - 'access', 'a.access', 'access_level', + 'catid', 'a.catid', 'category_id', + 'c.title', 'category_title', + 'state', 'a.state', 'published', + 'access', 'a.access', + 'ag.title', 'access_level', 'created', 'a.created', 'created_by', 'a.created_by', 'ordering', 'a.ordering', 'featured', 'a.featured', 'language', 'a.language', + 'l.title', 'language_title', 'hits', 'a.hits', 'publish_up', 'a.publish_up', 'publish_down', 'a.publish_down', 'url', 'a.url', + 'tag', + 'level', 'c.level', ); } @@ -60,33 +65,23 @@ class WeblinksModelWeblinks extends JModelList * @note Calling getState in this method will result in recursion. * @since 1.6 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'a.title', $direction = 'asc') { // Load the filter state. - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int'); - $this->setState('filter.access', $accessId); - - $published = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string'); - $this->setState('filter.state', $published); - - $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', ''); - $this->setState('filter.category_id', $categoryId); - - $language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', ''); - $this->setState('filter.language', $language); - - $tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', ''); - $this->setState('filter.tag', $tag); + $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string')); + $this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd')); + $this->setState('filter.published', $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string')); + $this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '', 'cmd')); + $this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string')); + $this->setState('filter.tag', $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '', 'string')); + $this->setState('filter.level', $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level', '', 'cmd')); // Load the parameters. $params = JComponentHelper::getParams('com_weblinks'); $this->setState('params', $params); // List state information. - parent::populateState('a.title', 'asc'); + parent::populateState($ordering, $direction); } /** @@ -107,9 +102,11 @@ class WeblinksModelWeblinks extends JModelList // Compile the store id. $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.access'); - $id .= ':' . $this->getState('filter.state'); + $id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.category_id'); $id .= ':' . $this->getState('filter.language'); + $id .= ':' . $this->getState('filter.tag'); + $id .= ':' . $this->getState('filter.level'); return parent::getStoreId($id); } @@ -136,47 +133,48 @@ class WeblinksModelWeblinks extends JModelList 'a.hits, a.state, a.access, a.ordering, a.language, a.publish_up, a.publish_down' ) ); - $query->from($db->quoteName('#__weblinks') . ' AS a'); + $query->from($db->quoteName('#__weblinks', 'a')); // Join over the language - $query->select('l.title AS language_title, l.image AS language_image') - ->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language'); + $query->select($db->quoteName('l.title', 'language_title')) + ->select($db->quoteName('l.image', 'language_image')) + ->join('LEFT', $db->quoteName('#__languages', 'l') . ' ON ' . $db->qn('l.lang_code') . ' = ' . $db->qn('a.language')); // Join over the users for the checked out user. - $query->select('uc.name AS editor') - ->join('LEFT', '#__users AS uc ON uc.id=a.checked_out'); + $query->select($db->quoteName('uc.name', 'editor')) + ->join('LEFT', $db->quoteName('#__users', 'uc') . ' ON ' . $db->qn('uc.id') . ' = ' . $db->qn('a.checked_out')); // Join over the asset groups. - $query->select('ag.title AS access_level') - ->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + $query->select($db->quoteName('ag.title', 'access_level')) + ->join('LEFT', $db->quoteName('#__viewlevels', 'ag') . ' ON ' . $db->qn('ag.id') . ' = ' . $db->qn('a.access')); // Join over the categories. $query->select('c.title AS category_title') - ->join('LEFT', '#__categories AS c ON c.id = a.catid'); + ->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON ' . $db->qn('c.id') . ' = ' . $db->qn('a.catid')); // Filter by access level. if ($access = $this->getState('filter.access')) { - $query->where('a.access = ' . (int) $access); + $query->where($db->quoteName('a.access') . ' = ' . (int) $access); } // Implement View Level Access if (!$user->authorise('core.admin')) { $groups = implode(',', $user->getAuthorisedViewLevels()); - $query->where('a.access IN (' . $groups . ')'); + $query->where($db->quoteName('a.access') . ' IN (' . $groups . ')'); } // Filter by published state - $published = $this->getState('filter.state'); + $published = $this->getState('filter.published'); if (is_numeric($published)) { - $query->where('a.state = ' . (int) $published); + $query->where($db->quoteName('a.state') . ' = ' . (int) $published); } elseif ($published === '') { - $query->where('(a.state IN (0, 1))'); + $query->where('(' . $db->quoteName('a.state') . ' IN (0, 1))'); } // Filter by category. @@ -184,7 +182,13 @@ class WeblinksModelWeblinks extends JModelList if (is_numeric($categoryId)) { - $query->where('a.catid = ' . (int) $categoryId); + $query->where($db->quoteName('a.catid') . ' = ' . (int) $categoryId); + } + + // Filter on the level. + if ($level = $this->getState('filter.level')) + { + $query->where($db->quoteName('c.level') . ' <= ' . (int) $level); } // Filter by search in title @@ -194,19 +198,19 @@ class WeblinksModelWeblinks extends JModelList { if (stripos($search, 'id:') === 0) { - $query->where('a.id = ' . (int) substr($search, 3)); + $query->where($db->quoteName('a.id') . ' = ' . (int) substr($search, 3)); } else { $search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%')); - $query->where('(a.title LIKE ' . $search . ' OR a.alias LIKE ' . $search . ')'); + $query->where('(' . $db->quoteName('a.title') . ' LIKE ' . $search . ' OR ' . $db->quoteName('a.alias') . ' LIKE ' . $search . ')'); } } // Filter on the language. if ($language = $this->getState('filter.language')) { - $query->where('a.language = ' . $db->quote($language)); + $query->where($db->quoteName('a.language') . ' = ' . $db->quote($language)); } $tagId = $this->getState('filter.tag'); @@ -223,8 +227,8 @@ class WeblinksModelWeblinks extends JModelList } // Add the list ordering clause. - $orderCol = $this->state->get('list.ordering'); - $orderDirn = $this->state->get('list.direction'); + $orderCol = $this->state->get('list.ordering', 'a.title'); + $orderDirn = $this->state->get('list.direction', 'ASC'); if ($orderCol == 'a.ordering' || $orderCol == 'category_title') { diff --git a/src/administrator/components/com_weblinks/views/weblinks/tmpl/default.php b/src/administrator/components/com_weblinks/views/weblinks/tmpl/default.php index fb8978c..0801f94 100644 --- a/src/administrator/components/com_weblinks/views/weblinks/tmpl/default.php +++ b/src/administrator/components/com_weblinks/views/weblinks/tmpl/default.php @@ -26,64 +26,17 @@ if ($saveOrder) $saveOrderingUrl = 'index.php?option=com_weblinks&task=weblinks.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'weblinkList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); } -$sortFields = $this->getSortFields(); - -JFactory::getDocument()->addScriptDeclaration(' - Joomla.orderTable = function() - { - table = document.getElementById("sortTable"); - direction = document.getElementById("directionTable"); - order = table.options[table.selectedIndex].value; - if (order != "' . $listOrder . '") - { - dirn = "asc"; - } - else - { - dirn = direction.options[direction.selectedIndex].value; - } - Joomla.tableOrdering(order, dirn, ""); - }; -'); ?>
-sidebar)) : ?> + sidebar)) : ?>
sidebar; ?>
- +
- -
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ + $this)); ?>
items)) : ?>
@@ -94,34 +47,34 @@ JFactory::getDocument()->addScriptDeclaration(' - ', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + - + - - + + - - - - - - - + - + + + + + + + - + - + pagination->getListFooter(); ?> @@ -135,7 +88,7 @@ JFactory::getDocument()->addScriptDeclaration(' $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0; $canChange = $user->authorise('core.edit.state', 'com_weblinks.category.' . $item->catid) && $canCheckin; ?> - + addScriptDeclaration(' - + - + id); ?> - state, $i, 'weblinks.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> +
+ state, $i, 'weblinks.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> + state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'weblinks'); + JHtml::_('actionsdropdown.' . ((int) $item->state === -2 ? 'un' : '') . 'trash', 'cb' . $i, 'weblinks'); + echo JHtml::_('actionsdropdown.render', $this->escape($item->title)); + } + ?> +
checked_out) : ?> @@ -172,10 +135,10 @@ JFactory::getDocument()->addScriptDeclaration(' escape($item->title); ?> - escape($item->alias));?> + escape($item->alias)); ?>
- escape($item->category_title); ?> + escape($item->category_title); ?>
@@ -185,7 +148,7 @@ JFactory::getDocument()->addScriptDeclaration(' hits; ?> - language == '*'):?> + language == '*') : ?> language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> @@ -205,8 +168,6 @@ JFactory::getDocument()->addScriptDeclaration(' - -
diff --git a/src/administrator/components/com_weblinks/views/weblinks/tmpl/default_batch.php b/src/administrator/components/com_weblinks/views/weblinks/tmpl/default_batch.php index 3c9844e..9598929 100644 --- a/src/administrator/components/com_weblinks/views/weblinks/tmpl/default_batch.php +++ b/src/administrator/components/com_weblinks/views/weblinks/tmpl/default_batch.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -$published = $this->state->get('filter.state'); +$published = $this->state->get('filter.published'); ?>