diff --git a/.gitignore b/.gitignore index d6e6aea..d12e231 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ composer.phar composer.lock .idea/ atlassian-ide-plugin.xml +ocular.phar +.reports/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 8025b3a..a25d84f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/composer.json b/composer.json index 2a8324e..3b3e261 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ }, "require-dev": { - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4.1", + "squizlabs/php_codesniffer": "1.*" }, "autoload": { diff --git a/runTests.sh b/runTests.sh new file mode 100755 index 0000000..da0a578 --- /dev/null +++ b/runTests.sh @@ -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 \ No newline at end of file diff --git a/src/Proxmox.php b/src/Proxmox.php index f91b679..8114331 100644 --- a/src/Proxmox.php +++ b/src/Proxmox.php @@ -478,5 +478,4 @@ protected function loginUsingCredentials($credentials) //$error = "This can't happen, run in circles or do something else."; //throw new \RuntimeException($error); } - }