Skip to content

Commit

Permalink
Added travis and coveralls ntegrations with unittests skeleton.
Browse files Browse the repository at this point in the history
  • Loading branch information
dorantor committed Oct 29, 2018
1 parent 860bce5 commit 20dd541
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
composer.lock
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
sudo: false

dist: trusty

language: php

php:
- nightly
- 7.2
- 7.1
- 7.0
- 5.6
- 5.5
- 5.4

matrix:
allow_failures:
- php: nightly
include:
- php: "5.3"
dist: precise

before_script:
- composer install --no-interaction

script:
- composer cover
- composer check-style

after_script:
- composer coveralls
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@
"require": {
"php": "^5.3|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8 | ^6.5",
"satooshi/php-coveralls": ">=0.7.1 <2.0",
"squizlabs/php_codesniffer": "^2.3"
},
"autoload": {
"psr-4": {
"Dorantor\\" : "src"
"Dorantor\\" : ["src/", "tests/"]
}
},
"scripts": {
"test": "./vendor/bin/phpunit -c ./tests/phpunit.xml",
"cover": "./vendor/bin/phpunit -c ./tests/phpunit.xml --coverage-clover build/logs/clover.xml",
"coveralls": "coveralls -v",
"check-style": "./vendor/bin/phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src",
"fix-style": "./vendor/bin/phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src"
}
}
2 changes: 1 addition & 1 deletion src/FileLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ public function release()

return false;
}
}
}
21 changes: 21 additions & 0 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<phpunit colors="true"
bootstrap="../vendor/autoload.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="true"
>

<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">./</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../src</directory>
</whitelist>
</filter>
</phpunit>

0 comments on commit 20dd541

Please sign in to comment.