Skip to content

Commit

Permalink
Merge pull request #2 from aotd1/improve-travis-ci
Browse files Browse the repository at this point in the history
Update travis-ci config adding scrutinizer-ci
  • Loading branch information
zzantares committed Jul 13, 2014
2 parents 98f5a02 + de985ec commit 3dd398b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ composer.phar
composer.lock
.idea/
atlassian-ide-plugin.xml
ocular.phar
.reports/
31 changes: 26 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
language: php
php:
- "5.5"
- "5.4"
- "5.3"
- 5.6
- 5.5
- 5.4
- 5.3
- hhvm

matrix:
allow_failures:
- php: hhvm

before_script:
- composer install
- composer self-update
- composer install --prefer-source

script:
- mkdir .reports
# Code style
- php vendor/bin/phpcs ./src/ --standard=PSR1 --encoding=utf-8 --report=summary
- php vendor/bin/phpcs ./src/ --standard=PSR2 --encoding=utf-8 --report=summary
# PHPUnit tests
- php vendor/bin/phpunit --configuration phpunit.xml --coverage-clover=.reports/clover.xml

after_success:
# Send cover
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover .reports/clover.xml

script: phpunit --configuration phpunit.xml --coverage-text
git:
depth: 1
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
},

"require-dev": {
"phpunit/phpunit": "~4.1"
"phpunit/phpunit": "~4.1",
"squizlabs/php_codesniffer": "1.*"
},

"autoload": {
Expand Down
12 changes: 12 additions & 0 deletions runTests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

composer install

# Code style
php vendor/bin/phpcs ./src/ --standard=PSR1 --encoding=utf-8 --report=emacs
php vendor/bin/phpcs ./src/ --standard=PSR2 --encoding=utf-8 --report=emacs

# PHPUnit tests
php vendor/bin/phpunit --coverage-html .reports

# open .reports/index.html
5 changes: 2 additions & 3 deletions src/Proxmox.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ protected function loginUsingCredentials($credentials)
$credentials->getHostname(),
$credentials->getUsername(),
$credentials->getPassword(),
$realm, // Make it optional?
$port // Make it optional?
$realm, // Make it optional?
$port // Make it optional?
);
}

Expand All @@ -457,5 +457,4 @@ protected function loginUsingCredentials($credentials)
//$error = "This can't happen, run in circles or do something else.";
//throw new \RuntimeException($error);
}

}

0 comments on commit 3dd398b

Please sign in to comment.