diff --git a/.coveralls.yml b/.coveralls.yml index 75aefc8..5cb8590 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,3 +1,4 @@ # for php-coveralls service_name: travis-ci -coverage_clover: build/logs/clover.xml +coverage_clover: clover.xml +json_path: coveralls-upload.json diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..26c5802 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,11 @@ +name: "Continuous Integration" + +on: + pull_request: + push: + branches: + tags: + +jobs: + ci: + uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x diff --git a/.gitignore b/.gitignore index 93cad44..b3efd80 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,12 @@ .php_cs.cache nbproject composer.lock -docs/html \ No newline at end of file +docs/html + +.phpunit.result.cache +/clover.xml +/coveralls-upload.json +/phpunit.xml +/vendor/ +.phpunit.result.cache +.phpcs-cache diff --git a/.laminas-ci.json b/.laminas-ci.json new file mode 100644 index 0000000..ec82d30 --- /dev/null +++ b/.laminas-ci.json @@ -0,0 +1,5 @@ +{ + "additional_composer_arguments": [ + "--prefer-stable" + ] +} diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..d6d90a1 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,8 @@ +getFinder()->in(__DIR__); + +$config->setCacheFile(__DIR__ . '/.php_cs.cache'); + +return $config; diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 363296d..0000000 --- a/.php_cs +++ /dev/null @@ -1,10 +0,0 @@ -getFinder()->in(__DIR__); - -$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__; - -$config->setCacheFile($cacheDir . '/.php_cs.cache'); - -return $config; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0d538c2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -language: php - -sudo: false - -matrix: - fast_finish: true - include: - - php: 7.1 - sudo: true - env: - - DEPENDENCIES="" - - EXECUTE_CS_CHECK=true - - TEST_COVERAGE=true - - php: 7.1 - sudo: true - env: - - DEPENDENCIES="--prefer-lowest --prefer-stable" - - php: 7.2 - sudo: true - env: - - DEPENDENCIES="" - - php: 7.2 - sudo: true - env: - - DEPENDENCIES="--prefer-lowest --prefer-stable" - -cache: - directories: - - $HOME/.composer/cache - - $HOME/.php-cs-fixer - - $HOME/.local - -before_script: - - mkdir -p "$HOME/.php-cs-fixer" - - phpenv config-rm xdebug.ini - - composer self-update - - composer update $DEPENDENCIES - -script: - - if [[ $TEST_COVERAGE == 'true' ]]; then php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml; else ./vendor/bin/phpunit; fi - - if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run; fi - -after_success: - - if [[ $TEST_COVERAGE == 'true' ]]; then php vendor/bin/coveralls -v; fi - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/61c75218816eebde4486 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/README.md b/README.md index 655ea38..a1a5dc0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Standard Projections for Prooph EventStore -[![Build Status](https://travis-ci.org/prooph/standard-projections.svg?branch=master)](https://travis-ci.org/prooph/standard-projections) +[![Continuous Integration](https://github.com/prooph/standard-projections/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/prooph/standard-projections/actions/workflows/continuous-integration.yml) [![Coverage Status](https://coveralls.io/repos/prooph/standard-projections/badge.svg?branch=master&service=github)](https://coveralls.io/github/prooph/standard-projections?branch=master) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/prooph/improoph) @@ -12,7 +12,7 @@ or by message name (`MessageNameStreamProjectionRunner`). See docs for more info ## Requirements -- PHP >= 7.1 +- PHP >= 7.4 - Prooph EventStore v7 ## Documentation diff --git a/composer.json b/composer.json index ba2d7c3..9d27a8e 100644 --- a/composer.json +++ b/composer.json @@ -17,17 +17,16 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": "^7.1", - "prooph/event-store": "^7.3.1" + "php": "^7.4 || ~8.0.0", + "prooph/event-store": "^7.5.3" }, "require-dev": { - "prooph/pdo-event-store": "^1.6", - "phpunit/phpunit": "^6.0", - "phpspec/prophecy": "^1.7", - "friendsofphp/php-cs-fixer": "2.8.4", - "prooph/php-cs-fixer-config": "^0.3", - "satooshi/php-coveralls": "^1.0", - "prooph/bookdown-template": "^0.2.3" + "php-coveralls/php-coveralls": "^2.2", + "phpspec/prophecy": "^1.10.3", + "phpunit/phpunit": "^9.5", + "prooph/bookdown-template": "^0.2.3", + "prooph/pdo-event-store": "^1.11", + "prooph/php-cs-fixer-config": "^0.5" }, "suggest": { "prooph/pdo-event-store": "^1.6 for usage with MariaDB, MySQL or Postgres as event store" @@ -47,8 +46,19 @@ } }, "config": { + "sort-packages": true, "preferred-install": { "prooph/*": "source" } + }, + "scripts": { + "check": [ + "@cs-check", + "@test" + ], + "cs-check": "php-cs-fixer fix -v --diff --dry-run", + "cs-fix": "php-cs-fixer fix -v --diff", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" } } diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index ecec2f0..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - ./tests/ - - - - - ./src/ - - - diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..44ac5fd --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,14 @@ + + + + + ./src + + + + + + ./tests + + + diff --git a/src/AllStreamProjectionRunner.php b/src/AllStreamProjectionRunner.php index f786f04..d14090d 100644 --- a/src/AllStreamProjectionRunner.php +++ b/src/AllStreamProjectionRunner.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/standard-projections. - * (c) 2016-2018 prooph software GmbH - * (c) 2016-2018 Sascha-Oliver Prolic + * (c) 2016-2022 prooph software GmbH + * (c) 2016-2022 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/CategoryStreamProjectionRunner.php b/src/CategoryStreamProjectionRunner.php index 6ccba4b..91df0f6 100644 --- a/src/CategoryStreamProjectionRunner.php +++ b/src/CategoryStreamProjectionRunner.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/standard-projections. - * (c) 2016-2018 prooph software GmbH - * (c) 2016-2018 Sascha-Oliver Prolic + * (c) 2016-2022 prooph software GmbH + * (c) 2016-2022 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/MessageNameStreamProjectionRunner.php b/src/MessageNameStreamProjectionRunner.php index 7e4b6df..acab38a 100644 --- a/src/MessageNameStreamProjectionRunner.php +++ b/src/MessageNameStreamProjectionRunner.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/standard-projections. - * (c) 2016-2018 prooph software GmbH - * (c) 2016-2018 Sascha-Oliver Prolic + * (c) 2016-2022 prooph software GmbH + * (c) 2016-2022 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/AllStreamProjectionRunnerTest.php b/tests/AllStreamProjectionRunnerTest.php index 48fc4fa..bcad042 100644 --- a/tests/AllStreamProjectionRunnerTest.php +++ b/tests/AllStreamProjectionRunnerTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/standard-projections. - * (c) 2016-2018 prooph software GmbH - * (c) 2016-2018 Sascha-Oliver Prolic + * (c) 2016-2022 prooph software GmbH + * (c) 2016-2022 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -93,22 +93,22 @@ public function it_emits_events_for_all_streams() $streamEvents->next(); $event = $streamEvents->current(); - $this->assertEquals(['3'], $event->payload()); + $this->assertEquals(['a'], $event->payload()); $streamEvents->next(); $event = $streamEvents->current(); - $this->assertEquals(['4'], $event->payload()); + $this->assertEquals(['b'], $event->payload()); $streamEvents->next(); $event = $streamEvents->current(); - $this->assertEquals(['a'], $event->payload()); + $this->assertEquals(['3'], $event->payload()); $streamEvents->next(); $event = $streamEvents->current(); - $this->assertEquals(['b'], $event->payload()); + $this->assertEquals(['4'], $event->payload()); $streamEvents->next(); $event = $streamEvents->current(); diff --git a/tests/CategoryStreamProjectionRunnerTest.php b/tests/CategoryStreamProjectionRunnerTest.php index 6ba7d94..66feda3 100644 --- a/tests/CategoryStreamProjectionRunnerTest.php +++ b/tests/CategoryStreamProjectionRunnerTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/standard-projections. - * (c) 2016-2018 prooph software GmbH - * (c) 2016-2018 Sascha-Oliver Prolic + * (c) 2016-2022 prooph software GmbH + * (c) 2016-2022 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/MessageNameStreamProjectionRunnerTest.php b/tests/MessageNameStreamProjectionRunnerTest.php index b47c4a6..fa05a3a 100644 --- a/tests/MessageNameStreamProjectionRunnerTest.php +++ b/tests/MessageNameStreamProjectionRunnerTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/standard-projections. - * (c) 2016-2018 prooph software GmbH - * (c) 2016-2018 Sascha-Oliver Prolic + * (c) 2016-2022 prooph software GmbH + * (c) 2016-2022 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/TestDomainEvent.php b/tests/Mock/TestDomainEvent.php index 2ebe43f..495e1df 100644 --- a/tests/Mock/TestDomainEvent.php +++ b/tests/Mock/TestDomainEvent.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/standard-projections. - * (c) 2016-2018 prooph software GmbH - * (c) 2016-2018 Sascha-Oliver Prolic + * (c) 2016-2022 prooph software GmbH + * (c) 2016-2022 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code.