Skip to content

Commit

Permalink
chore(tests): update PHPUnit to 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
COil committed Dec 26, 2023
1 parent 8b844b0 commit 9b45125
Show file tree
Hide file tree
Showing 10 changed files with 1,761 additions and 326 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/symfony.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:

# Tests
- name: Execute tests via PHPUnit
run: vendor/bin/simple-phpunit
run: vendor/bin/phpunit
#run: castor test:all

# Code coverage
- name: Generate the code coverage report and show the current global coverage
run: |
php -d xdebug.enable=1 -d memory_limit=-1 vendor/bin/simple-phpunit --coverage-html=var/coverage
php -d xdebug.enable=1 -d memory_limit=-1 vendor/bin/phpunit --coverage-html=var/coverage
php bin/coverage-checker.php var/coverage/clover.xml 100
# run all lint/CS checks (non critical)
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Install PHP dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Install PHPUnit dependencies for PHPStan
run: vendor/bin/simple-phpunit --version
run: vendor/bin/phpunit --version

# native Symfony lints
- name: Lint the DI container
Expand Down
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> symfony/phpunit-bridge ###
/phpunit.xml
.phpunit.result.cache
###< symfony/phpunit-bridge ###

###> jolicode/castor ###
.castor.stub.php
###< jolicode/castor ###

###> symfony/asset-mapper ###
/public/assets/
###< symfony/asset-mapper ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
.phpunit.cache
###< phpunit/phpunit ###
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ purge: ## Purge all Symfony cache and logs

## —— Tests ✅ —————————————————————————————————————————————————————————————————
test: ## Run all PHPUnit tests
@vendor/bin/simple-phpunit
@vendor/bin/phpunit

coverage: ## Generate the HTML PHPUnit code coverage report (stored in var/coverage)
coverage: purge
@XDEBUG_MODE=coverage php -d xdebug.enable=1 -d memory_limit=-1 vendor/bin/simple-phpunit --coverage-html=var/coverage
@XDEBUG_MODE=coverage php -d xdebug.enable=1 -d memory_limit=-1 vendor/bin/phpunit --coverage-html=var/coverage
@php bin/coverage-checker.php var/coverage/clover.xml 100

cov-report: var/coverage/index.html ## Open the PHPUnit code coverage report (var/coverage/index.html)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Enjoy!

## Requirements ⚙

* [PHP 8.2](https://www.php.net/releases/8.2/en.php) (also works with [PHP 8.3](https://github.com/strangebuzz/MicroSymfony/actions/runs/7293571059/job/19876895409))
* [PHP 8.3](https://www.php.net/releases/8.3/en.php) (also works with [PHP 8.2](https://github.com/strangebuzz/MicroSymfony/actions/runs/7331493507/job/19964206101))
* The [Symfony CLI](https://symfony.com/download)


Expand All @@ -61,7 +61,7 @@ Enjoy!
* [Symfony 7.0](https://symfony.com/7)
* [Twig 3.8](https://twig.symfony.com)
* [Stimulus 3.2](https://stimulus.hotwired.dev/)
* [PHPUnit 9.5](https://phpunit.de)
* [PHPUnit 10.5](https://phpunit.de)
* The classless [BareCSS](http://barecss.com) CSS framework


Expand Down
25 changes: 0 additions & 25 deletions bin/phpunit

This file was deleted.

4 changes: 2 additions & 2 deletions castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function purge(): void
function test(): void
{
title(__FUNCTION__, get_command());
run('vendor/bin/simple-phpunit', quiet: false);
run('vendor/bin/phpunit', quiet: false);
io()->writeln('');
success();
}
Expand All @@ -99,7 +99,7 @@ function test(): void
function coverage(): void
{
title(__FUNCTION__, get_command());
run('php -d xdebug.enable=1 -d memory_limit=-1 vendor/bin/simple-phpunit --coverage-html=var/coverage',
run('php -d xdebug.enable=1 -d memory_limit=-1 vendor/bin/phpunit --coverage-html=var/coverage',
environment: [
'XDEBUG_MODE' => 'coverage',
],
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"phpstan/phpstan-symfony": "^1.3",
"roave/security-advisories": "dev-latest",
"symfony/browser-kit": "~7.0.0",
"phpunit/phpunit": "^10.0",
"symfony/css-selector": "~7.0.0",
"symfony/phpunit-bridge": "^7.0",
"symfony/requirements-checker": "^2.0",
"symfony/stopwatch": "~7.0.0",
"symfony/web-profiler-bundle": "~7.0.0"
Expand Down
Loading

0 comments on commit 9b45125

Please sign in to comment.