diff --git a/.gitignore b/.gitignore index 404d000..1463c05 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ Desktop.ini *.swp *~.nib *~ +*.travis/* # Ignore mergetool files *.orig @@ -34,7 +35,6 @@ build.properties phing-latest.phar # Composer -composer.lock composer.phar vendor/* tests/vendor/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..55298c6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: php +php: +- 5.4 +before_script: +- composer install + +script: +- vendor/bin/robo check:codestyle diff --git a/README.md b/README.md index 538371d..578b10d 100644 --- a/README.md +++ b/README.md @@ -103,3 +103,13 @@ You should remove the WebDriver module and replace it with the JoomlaBrowser mod AcceptanceHelper: ... ``` + +## Tools +Joomla Browser comes with a set of tools added via robo.li + +### Code Style Checker +To check automatically the code style execute the following commands in your Terminal window at the root of the repository: + +- `$ composer install` +- `$ vendor/bin/robo` +- `$ vendor/bin/robo check:codestyle` \ No newline at end of file diff --git a/RoboFile.php b/RoboFile.php new file mode 100644 index 0000000..e17c466 --- /dev/null +++ b/RoboFile.php @@ -0,0 +1,48 @@ +extension = '.exe'; + } + } + + /** + * Check the code style of the project against a passed sniffers using PHP_CodeSniffer_CLI + * + * @param string $sniffersPath Path to the sniffers. If not provided Joomla Coding Standards will be used. + */ + public function checkCodestyle($sniffersPath = null) + { + if (is_null($sniffersPath)) + { + $this->say('Downloading Joomla Coding Standards Sniffers'); + $this->_exec("git $this->extension clone -b master --single-branch --depth 1 https://github.com/joomla/coding-standards.git .travis/phpcs/Joomla"); + $sniffersPath = __DIR__ . '/.travis/phpcs/Joomla'; + } + + $this->taskCheckCodeStyle() + ->inspect(__DIR__ . '/src') + ->dontStopOnFail(true) + ->standard($sniffersPath) + ->run(); + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index 6177815..e16c6e1 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,11 @@ } ], "require": { - "php": ">=5.3.0", - "codeception/codeception": "2.*" + "php": ">=5.3.0" + }, + "require-dev": { + "codegyre/robo": "^0.5.3", + "joomla-projects/robo": "dev-master" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..a2d5756 --- /dev/null +++ b/composer.lock @@ -0,0 +1,562 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "c6efeee38ee190978ffc8e80a2704961", + "packages": [], + "packages-dev": [ + { + "name": "codegyre/robo", + "version": "0.5.3", + "source": { + "type": "git", + "url": "https://github.com/Codegyre/Robo.git", + "reference": "a668fde69e30bbd489442d2953cb57d07a4c29d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codegyre/Robo/zipball/a668fde69e30bbd489442d2953cb57d07a4c29d5", + "reference": "a668fde69e30bbd489442d2953cb57d07a4c29d5", + "shasum": "" + }, + "require": { + "henrikbjorn/lurker": "1.0.*@dev", + "php": ">=5.4.0", + "symfony/console": "~2.5", + "symfony/filesystem": "~2.5", + "symfony/finder": "~2.5", + "symfony/process": "~2.5" + }, + "require-dev": { + "codeception/aspect-mock": "0.5.*", + "codeception/base": "~2.1", + "codeception/verify": "0.2.*", + "natxet/cssmin": "~3.0", + "patchwork/jsqueeze": "~1.0" + }, + "bin": [ + "robo" + ], + "type": "library", + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2015-07-14 23:31:50" + }, + { + "name": "henrikbjorn/lurker", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/henrikbjorn/Lurker.git", + "reference": "a020d45b3bc37810aeafe27343c51af8a74c9419" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/henrikbjorn/Lurker/zipball/a020d45b3bc37810aeafe27343c51af8a74c9419", + "reference": "a020d45b3bc37810aeafe27343c51af8a74c9419", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/config": "~2.2", + "symfony/event-dispatcher": "~2.2" + }, + "suggest": { + "ext-inotify": ">=0.1.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Lurker": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Henrik Bjornskov", + "email": "henrik@bjrnskov.dk", + "homepage": "http://henrik.bjrnskov.dk" + }, + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Yaroslav Kiliba", + "email": "om.dattaya@gmail.com" + } + ], + "description": "Resource Watcher.", + "keywords": [ + "filesystem", + "resource", + "watching" + ], + "time": "2013-05-24 06:47:29" + }, + { + "name": "joomla-projects/robo", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/joomla-projects/robo.git", + "reference": "8a9c72f61696a4f288ede8212a0e7c7c47eda360" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-projects/robo/zipball/8a9c72f61696a4f288ede8212a0e7c7c47eda360", + "reference": "8a9c72f61696a4f288ede8212a0e7c7c47eda360", + "shasum": "" + }, + "require": { + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "joomla_projects\\robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Javier", + "email": "javier.gomez@community.joomla.org" + } + ], + "description": "Robo tasks for Joomla Quality Assurance", + "keywords": [ + "BDD", + "robo", + "task" + ], + "time": "2015-08-07 16:24:43" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.1.2" + }, + "suggest": { + "phpunit/php-timer": "dev-master" + }, + "bin": [ + "scripts/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-phpcs-fixer": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/CommentParser/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2014-12-04 22:32:15" + }, + { + "name": "symfony/config", + "version": "v2.7.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/6c905bbed1e728226de656e4c07d620dfe9e80d9", + "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2015-07-09 16:07:40" + }, + { + "name": "symfony/console", + "version": "v2.7.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/d6cf02fe73634c96677e428f840704bfbcaec29e", + "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.1" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2015-07-28 15:18:12" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.7.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.6", + "symfony/expression-language": "~2.6", + "symfony/phpunit-bridge": "~2.7", + "symfony/stopwatch": "~2.3" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2015-06-18 19:21:56" + }, + { + "name": "symfony/filesystem", + "version": "v2.7.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", + "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2015-07-09 16:07:40" + }, + { + "name": "symfony/finder", + "version": "v2.7.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", + "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2015-07-09 16:07:40" + }, + { + "name": "symfony/process", + "version": "v2.7.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process.git", + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2015-07-01 11:25:50" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "joomla-projects/robo": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.0" + }, + "platform-dev": [] +}