Skip to content

Commit

Permalink
Get rid of phpunit bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 11, 2024
1 parent 590984a commit 0850175
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 94 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
/phpunit-phpstan.xml.dist export-ignore
/tests export-ignore
/CONTRIBUTING.md export-ignore
44 changes: 1 addition & 43 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,46 +51,4 @@ jobs:
composer update ${{ env.COMPOSER_FLAGS }}
- name: "Run tests"
run: "vendor/bin/simple-phpunit --verbose"

phpstan_tests:
name: "CI PHPStan Ext"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "7.3"
- "8.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: "Install latest dependencies"
run: |
# Require PHPUnit directly bypassing the symfony bridge
composer remove symfony/phpunit-bridge --dev --no-update
composer require phpunit/phpunit:^9 --dev --no-update
composer update ${{ env.COMPOSER_FLAGS }}
- name: "Run tests"
run: vendor/bin/phpunit -c phpunit-phpstan.xml.dist
run: "vendor/bin/phpunit"
3 changes: 0 additions & 3 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,5 @@ jobs:
- name: "Install latest dependencies"
run: "composer update ${{ env.COMPOSER_FLAGS }}"

- name: "Initialize PHPUnit sources"
run: "vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS"

- name: "Run PHPStan"
run: "composer phpstan"
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php": "^7.2 || ^8.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^7",
"phpunit/phpunit": "^8 || ^9",
"phpstan/phpstan": "^1.11.6",
"phpstan/phpstan-strict-rules": "^1.1"
},
Expand All @@ -43,7 +43,7 @@
}
},
"scripts": {
"test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit",
"test": "vendor/bin/phpunit",
"phpstan": "phpstan analyse"
}
}
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
treatPhpDocTypesAsCertain: false

bootstrapFiles:
- tests/phpstan-locate-phpunit-autoloader.php
- vendor/autoload.php

excludePaths:
- tests/PHPStanTests/nsrt/*
Expand Down
20 changes: 0 additions & 20 deletions phpunit-phpstan.xml.dist

This file was deleted.

3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
>
<testsuites>
<testsuite name="PCRE Test Suite">
<directory>tests/PregTests</directory>
<directory>tests/RegexTests</directory>
<directory>tests</directory>
</testsuite>
</testsuites>

Expand Down
22 changes: 0 additions & 22 deletions tests/phpstan-locate-phpunit-autoloader.php

This file was deleted.

0 comments on commit 0850175

Please sign in to comment.