diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..467bf77 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: php +php: + - 7.3 +before_install: + - phpenv config-rm xdebug.ini || true + +install: + - composer install + - if [[ "$DEPS" = 'high' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS update; fi + - if [[ "$DEPS" = 'low' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-lowest --prefer-stable update; fi + - if [[ "$DEPS" = 'stable' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-stable update; fi + +script: composer check + +env: + matrix: + - DEPS="low" + - DEPS="high" + - DEPS="stable" + global: + - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-suggest" diff --git a/codeception.yml b/codeception.yml new file mode 100644 index 0000000..405575a --- /dev/null +++ b/codeception.yml @@ -0,0 +1,11 @@ +namespace: Psalm\PhpUnitPlugin\Tests +paths: + tests: tests + output: tests/_output + data: tests/_data + support: tests/_support + envs: tests/_envs +actor_suffix: Tester +extensions: + enabled: + - Codeception\Extension\RunFailed diff --git a/composer.json b/composer.json index 38d4a8a..61da409 100755 --- a/composer.json +++ b/composer.json @@ -14,7 +14,9 @@ "vimeo/psalm": "^3.0 || dev-master" }, "require-dev": { - "squizlabs/php_codesniffer": "^3.3" + "squizlabs/php_codesniffer": "^3.3.1", + "codeception/base": "^2.5", + "weirdan/codeception-psalm-module": "dev-master" }, "extra": { "psalm": { @@ -26,13 +28,20 @@ "Psalm\\PhpUnitPlugin\\": ["."] } }, + "autoload-dev": { + "psr-4": { + "Psalm\\PhpUnitPlugin\\Tests\\": ["tests/_support"] + } + }, "scripts" : { "check": [ "@cs-check", - "@analyze" + "@analyze", + "@test" ], "analyze": "psalm", "cs-check": "phpcs", - "cs-fix": "phpcbf" + "cs-fix": "phpcbf", + "test": "codecept run -v" } } diff --git a/psalm.xml.dist b/psalm.xml.dist index fa52336..633d409 100755 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -9,13 +9,16 @@ - + + - - + + + + diff --git a/tests/_data/.gitkeep b/tests/_data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/_output/.gitignore b/tests/_output/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/tests/_output/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/tests/_run/.gitignore b/tests/_run/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/tests/_run/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php new file mode 100644 index 0000000..abbab72 --- /dev/null +++ b/tests/_support/AcceptanceTester.php @@ -0,0 +1,26 @@ +