mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-09-12 21:50:57 -04:00
Closes #9288 Changes proposed in this pull request: The mark-as-read links contain the resolved state, so the automatic reading preference becomes an explicit `state=2` filter after the redirect. Once the last unread article is marked read, the page stays empty instead of showing all articles. - Keep the requested state separately from the resolved state used by the action. A redirect state of `0` reapplies the reading preference; explicit filters still survive the redirect as intended by #9007. - Carry that value through the menu, footer and “Load more” link. This matters with oldest-first pagination, where the last footer supplies the menu button's action. - Add request-state and rendered-pagination tests, plus a changelog entry. How to test the feature manually: 1. With both read and unread articles, choose “Show unreads if any, all articles otherwise”. Mark all as read from the footer, then repeat using the top button. The resulting page should show the read articles. 2. Set one article per page and oldest-first sorting. Load the remaining articles before marking all as read; the same fallback should work. 3. Select an explicit unread filter: marking everything read should still leave an empty unread view. Also check a favourite filter with a search term, including “Mark selection unread”; the search and favourite scope should remain intact. Validation: `make NO_DOCKER=1 fix-all` and `make NO_DOCKER=1 test-all` pass with PHP 8.5.9 (719 PHPUnit tests, 1,378 assertions). Browser checks passed against SQLite in Chromium (desktop and mobile viewport) and Firefox. The original footer fails three of the six new rendered-pagination cases.
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.