Skip to content

Improve type-security with phpstan and set up phpunit#1004

Open
alsciende wants to merge 11 commits intoNull-Signal-Games:mainfrom
alsciende:chore/upgrade-symfony
Open

Improve type-security with phpstan and set up phpunit#1004
alsciende wants to merge 11 commits intoNull-Signal-Games:mainfrom
alsciende:chore/upgrade-symfony

Conversation

@alsciende
Copy link
Copy Markdown
Collaborator

@alsciende alsciende commented Apr 12, 2026

The goal is to prepare an upgrade of Symfony from the 3.x version to an up-to-date 8.x version. For this, we need a better test suite to prevent regression. So phpstan and phpunit need to strongly constraint future code evolutions.

What this PR changes in the code:

  • use phpstan level 3 to improve types and fix a few bugs in older controllers
  • convert deprecated YAML mappings to XML mappings for Doctrine 3.x
  • set up phpunit with a test container and a test database
  • remove doctrine/doctrine-fixtures-bundle which is not used anymore
  • include a mysql dump for the test database

What this PR brings to the table:

  • a test container named nrdb-test which is distinct from the dev container, and is used to run phpunit (and other test tools that would need Symfony in a test env)
  • a test database named nrdb-test-db which is distinct from the test database, and is automatically loaded with some testing fixtures commited to tests/fixtures/mysqldump. The tests use these fixtures to be reproducible and consistant.

To run the tests, execute this from your nrdb-dev-env directory:

docker compose exec -it -u www-data nrdb-test bash -c 'make test'

@alsciende alsciende changed the title Chore/upgrade symfony Improve type-security with phpstan and set up phpunit Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant