Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Desktop.ini
*.swp
*~.nib
*~
*.travis/*

# Ignore mergetool files
*.orig
Expand All @@ -34,7 +35,6 @@ build.properties
phing-latest.phar

# Composer
composer.lock
composer.phar
vendor/*
tests/vendor/*
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: php
php:
- 5.4
before_script:
- composer install

script:
- vendor/bin/robo check:codestyle
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
48 changes: 48 additions & 0 deletions RoboFile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
// Load tasks from composer, see composer.json
use \joomla_projects\robo\loadTasks;

private $extension = '';

/**
* Set the Execute extension for Windows Operating System
*
* @return void
*/
private function setExecExtension()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$this->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();
}
}
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading