diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b93029b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/phpcs.xml export-ignore diff --git a/.travis.yml b/.travis.yml index e4c6453..dc20b50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,54 @@ -sudo: false +dist: xenial language: php +stages: + - name: "Lint" + - name: "PHP Unit tests" + cache: directories: - - $HOME/.composer/cache - - $HOME/.local - - vendor - -matrix: - fast_finish: true - include: - - php: 7.1 - env: - - EXECUTE_CS_CHECK=true - - EXECUTE_TEST_COVERALLS=true - - PATH="$HOME/.local/bin:$PATH" - - php: nightly - allow_failures: - - php: nightly - -before_install: - - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - - composer self-update - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:dev-master ; fi + - $HOME/.composer/cache/ install: - - travis_retry composer install --no-interaction - - composer info -i + - composer install --no-interaction script: - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi - - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then vendor/bin/phpunit ; fi - - if [[ $EXECUTE_CS_CHECK == 'true' ]]; then vendor/bin/phpcs ; fi + - ./vendor/bin/phpunit --coverage-clover clover.xml + +after_success: + - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar + - chmod +x php-coveralls.phar + - php php-coveralls.phar -vvv + +jobs: + allow_failures: + - php: nightly -after_script: - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then vendor/bin/coveralls ; fi + include: + - stage: "Lint" + name: "Lint files" + before_install: phpenv config-rm xdebug.ini + after_success: skip + script: ./vendor/bin/phpcs + + - stage: "PHP Unit tests" + php: 7.1 + name: "PHP 7.1" + - stage: "PHP Unit tests" + php: 7.2 + name: "PHP 7.2" + - stage: "PHP Unit tests" + php: 7.3 + name: "PHP 7.3" + - stage: "PHP Unit tests" + php: 7.4 + name: "PHP 7.4" + - stage: "PHP Unit tests" + php: nightly + name: "PHP nightly" + install: + - composer install --no-interaction --ignore-platform-reqs notifications: email: true diff --git a/composer.json b/composer.json index 41184d3..b3d745a 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,9 @@ "authors": [ { "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", "homepage": "https://dasprids.de/", - "email": "mail@dasprids.de" + "role": "Developer" } ], "keywords": [ @@ -14,8 +15,8 @@ "map" ], "require-dev": { - "phpunit/phpunit": "^6.4", - "squizlabs/php_codesniffer": "^3.1" + "phpunit/phpunit": "^7 | ^8 | ^9", + "squizlabs/php_codesniffer": "^3.4" }, "autoload": { "psr-4": { diff --git a/test/AbstractEnumTest.php b/test/AbstractEnumTest.php index ddba7d3..58ca913 100644 --- a/test/AbstractEnumTest.php +++ b/test/AbstractEnumTest.php @@ -14,7 +14,7 @@ final class AbstractEnumTest extends TestCase { - public function setUp() + public function setUp(): void { $reflectionClass = new ReflectionClass(AbstractEnum::class);