diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..74a4e86 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/e2e export-ignore diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000..37aaea7 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,45 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Integration tests" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + test: + name: "Integration test" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + - "8.0" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Install dependencies" + working-directory: "e2e" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Test" + working-directory: "e2e" + run: "vendor/bin/phpstan analyse -l 8 FooTest.php" + + - name: "Rename directory" + run: "mv e2e e3e" + + - name: "Test relative paths - after renaming" + working-directory: "e3e" + run: "vendor/bin/phpstan analyse -l 8 FooTest.php" diff --git a/e2e/.gitignore b/e2e/.gitignore new file mode 100644 index 0000000..ff72e2d --- /dev/null +++ b/e2e/.gitignore @@ -0,0 +1,2 @@ +/composer.lock +/vendor diff --git a/e2e/FooTest.php b/e2e/FooTest.php new file mode 100644 index 0000000..4686456 --- /dev/null +++ b/e2e/FooTest.php @@ -0,0 +1,21 @@ +assertNotNull($std); + $this->requireStd($std); + } + + private function requireStd(\stdClass $std): void + { + + } + +} diff --git a/e2e/composer.json b/e2e/composer.json new file mode 100644 index 0000000..bbc1b35 --- /dev/null +++ b/e2e/composer.json @@ -0,0 +1,17 @@ +{ + "require": { + "phpstan/phpstan": "^0.12.62", + "phpstan/extension-installer": "dev-master", + "phpstan/phpstan-phpunit": "^0.12.17", + "phpunit/phpunit": "^9.5" + }, + "repositories": [ + { + "type": "path", + "url": "..", + "options": { + "symlink": false + } + } + ] +}