diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7579f74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor +composer.lock diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..53235e5 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/composer.json b/composer.json index c00ca5a..0ab3555 100644 --- a/composer.json +++ b/composer.json @@ -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" } } \ No newline at end of file diff --git a/src/FileLock.php b/src/FileLock.php index 5ff4bc9..d59e837 100644 --- a/src/FileLock.php +++ b/src/FileLock.php @@ -97,4 +97,4 @@ public function release() return false; } -} \ No newline at end of file +} diff --git a/tests/phpunit.xml b/tests/phpunit.xml new file mode 100644 index 0000000..3031c23 --- /dev/null +++ b/tests/phpunit.xml @@ -0,0 +1,21 @@ + + + + + + ./ + + + + + + ../src + + +