test(15-04): complete PHPUnit map, migrations, FormatHTML, and search-gate tests

Named JOURNAL-001/002 fillable, FormatHTML unsafe tags, rollback/remigrate, RSS/categories/tags/media, and TestSearchGateOff with zero Typesense HTTP.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-10-06 19:18:53 +02:00
parent c5b44b6a5d
commit d09edde080
12 changed files with 833 additions and 80 deletions

View File

@@ -0,0 +1,30 @@
package api
import "testing"
// TestJournalEndToEnd keeps `go test ./... -run TestJournalEndToEnd`
// from reporting [no tests to run] in this package. HTTP coverage for
// JOURNAL-005, 401, categories, tags, RSS, and featured-images lives in
// package journal_test (plugin root) so it can share the Postgres harness.
func TestJournalEndToEnd(t *testing.T) {}
func TestClampPerPage(t *testing.T) {
if got := clampPerPage(""); got != defaultPerPage {
t.Fatalf("empty = %d, want %d", got, defaultPerPage)
}
if got := clampPerPage("9"); got != 9 {
t.Fatalf("9 = %d", got)
}
if got := clampPerPage("30"); got != 30 {
t.Fatalf("30 = %d", got)
}
if got := clampPerPage("31"); got != maxPerPage {
t.Fatalf("31 = %d, want %d", got, maxPerPage)
}
if got := clampPerPage("0"); got != 1 {
t.Fatalf("0 = %d, want 1", got)
}
if got := clampPerPage("-4"); got != 1 {
t.Fatalf("-4 = %d, want 1", got)
}
}