Skip to content

Testing

phil/content-warnings-bundle
AreaWhat is covered
CatalogueFactory, CatalogueLabels, WarningScreenThe base list, files and definition in order, labels by locale and fallbacks, choices, decisions
SessionWarningPreferences, InMemoryWarningPreferencesSaving and reading, the main request, no session, unreadable preferences, resetting
ContentWarningsColumnTypeJSON, null and empty, every refusal
ContentWarningsType, WarningPreferencesType and their transformersChoices by category and locale, kept severities, notes and unlisted themes, options
ContentWarningsExtension, PhilContentWarningsBundleThe functions; the services, the configuration, a broken catalogue, the prepended configuration
The Stimulus controllerEvents, revealing with and without reduced motion, concealing, under Node's test runner

A functional suite boots a kernel with FrameworkBundle, DoctrineBundle on SQLite, TwigBundle and this bundle: ContentWarningsBundleTest stores warnings, renders the template folded, hidden and shown, and the forms in fr_CA. Installed on its own, where FrameworkBundle is a development requirement, the suite is skipped.

vendor/bin/phpunit packages/content-warnings-bundle/tests
node --import ./tests/js/register.mjs --test tests/js   # from packages/content-warnings-bundle