freshrss/edge/docs/en/developers
03_Running_tests| modified | Tuesday 15 September 2026 |
|---|
FreshRSS is tested with PHPUnit, PHPStan, PHP_CodeSniffer, and more.
No code should be merged in edge if the tests don’t pass.
As a developer, you can run the test suite on your PC easily with make commands. You can run the test suite with:
1cd ./FreshRSS/
2make test-all
Some syntax, formatting, whitespace, and i18n conventions can be fixed automatically with:
1make fix-all
Some tests can run inside some Docker images, in particular to test against minimum and maximum versions of PHP:
1# Prepare
2make composer-test
3docker build --pull --tag freshrss/freshrss:oldest -f Docker/Dockerfile-Oldest .
4docker build --pull --tag freshrss/freshrss:newest -f Docker/Dockerfile-Newest .
5
6# Run
7docker run --rm -e FRESHRSS_ENV=development -e TZ=UTC -v $(pwd):/var/www/FreshRSS freshrss/freshrss:oldest bin/composer test
8docker run --rm -e FRESHRSS_ENV=development -e TZ=UTC -v $(pwd):/var/www/FreshRSS freshrss/freshrss:newest bin/composer test
Tests are automatically run when you open a pull request on GitHub.
They are performed with GitHub Actions.
This ensures your code will not introduce some kind of regression. We will not merge a PR if tests fail so we will ask you to fix any bugs before reviewing your code.
If you are interested, you can take a look at the configuration file.
As feed data is volatile, it’s better to work with snapshots when debugging some issues.
Check the description to retrieve a snapshot.
To serve those snapshots, you can use a mock server.
Here we will demonstrate how to work with WireMock but other solutions exist.
Here are the steps to start using the WireMock mock server:
1{
2 "request": {
3 "method": "GET",
4 "urlPathPattern": "/.*"
5 },
6 "response": {
7 "status": 200,
8 "bodyFileName": "{{ '{{' }}request.pathSegments.[0]}}",
9 "transformers": ["response-template"],
10 "headers": {
11 "Content-Type": "application/rss+xml"
12 }
13 }
14}
1# <PORT> is the port used on the host to communicate with the server
2# <NETWORK> is the name of the docker network used (by default, it’s freshrss-network)
3docker run -it --rm -p <PORT>:8080 --name wiremock --network <NETWORK> -v $PWD:/home/wiremock wiremock/wiremock:latest-alpine --local-response-templating
<RSS> mock file directly:
http://localhost:<PORT>/<RSS>,http://wiremock:8080/<RSS>.