Files
FreshRSS/tests
Jamal Kamaladdinoglu 2bb901d9c4 Accept a trusted proxy address given without a subnet (#9301)
TRUSTED_PROXY=192.168.1.1 is ignored and only 192.168.1.1/32 is honoured. checkCIDR() splits the range on the slash and rejects the value when the mask part is missing, so an address written without a subnet never matches.

An address without a subnet is now read as a single host: /32 for IPv4 and /128 for IPv6. That is the format docs/en/admins/09_AccessControl.md points at.

Host names such as gateway.localdomain are still not resolved.

tests/app/Utils/httpUtilTest.php gains 16 cases for checkCIDR, two of which fail without this change.

Refs #9210
2026-09-13 22:34:39 +02:00
..
2023-11-16 22:43:00 +01:00
2024-09-06 09:06:46 +02:00

FreshRSS tests

See our documentation about running tests.

make test-all

See test.yml for the GitHub Actions automated tests.

See composer.json for the different tests and versions, to be run locally.

Details about this tests folder

Unit tests are based on PHPUnit. Here is an example of manual install:

cd ./tests/
wget -O phpunit.phar https://phar.phpunit.de/phpunit-10.phar
php phpunit.phar --bootstrap bootstrap.php

The shellchecks.sh script is used to safeguard shell scripts from common shell script bugs and to ensure a consistent style. It requires ShellCheck and shfmt.