Add PHPUnit test suite, Gitea CI, and fix broken URL pattern
All checks were successful
CI / test (push) Successful in 1m41s

- Add 22 unit tests covering feed parsing, thread rendering, facets,
  needsRefetch staleness windows, and handleConfigureAction
- Add FreshRSS class stubs so tests run without a full FreshRSS install
- Add RSS feed fixture (hockeyviz.com snapshot) and thread API fixture
  for post 3mhtk7awhrp26 (1 root + 2 replies)
- Add Gitea Actions workflow (.gitea/workflows/ci.yml) running on PHP 8.2
- Fix POST_URL_PATTERN: using '#' as PCRE delimiter with '#' inside a
  character class caused PHP to close the pattern early, so no Bluesky
  URL ever matched; switch delimiter to '~'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 15:41:07 -03:00
parent ac3b584d66
commit 932d7a5f0e
11 changed files with 2443 additions and 1 deletions

26
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,26 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: json, simplexml
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run tests
run: vendor/bin/phpunit