Files
FreshRSS/tests
TowyTowyandClaude Fable 5 8c5bd58808 Fix SQL errors breaking regex search on MySQL / MariaDB (#9036)
On MySQL and MariaDB (the compressed content_bin code path,
isCompressed() === true), three of the four regex-search constructions
in FreshRSS_EntryDAO::sqlBooleanSearch() generated invalid SQL, so the
query failed and the search silently returned zero articles:

* intext:/regex/ appended a stray closing parenthesis after
  sqlRegex(...) (MySQL error 1248);
* -intext:/regex/ had the same stray parenthesis;
* -/regex/ emitted ' ANT NOT ' instead of ' AND NOT '
  (MySQL error 1064).

sqlRegex() already returns a self-contained, balanced expression
(REGEXP_LIKE(expr, ?, 'flags') or expr REGEXP ?), so no extra
parenthesis is needed, matching the uncompressed (SQLite / PostgreSQL)
branches.

The existing MySQL / MariaDB unit tests for intext:/regex/ had
captured the buggy unbalanced SQL as their expected strings; they are
corrected, and new cases are added for -intext:/regex/ and -/regex/
on both flavours.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 17:50:16 +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.