Skip to content

Fix functional tests: replace smoke assertions with meaningful checks #173

@avandenberghe

Description

@avandenberghe

Summary

All five tests in tests/functional/recenttopics_test.php assert only $crawler->filter('html')->count() >= 1 — which passes as long as the page does not return a 500 error. These are smoke tests with no signal value.

Current state

Test Current assertion Problem
test_rt_page html element exists Passes even if RT block is empty or broken
test_rt_simple_page html element exists Same
test_rt_page_disabled html element exists Doesn't verify the block is actually hidden
test_index_has_recent_topics html element exists Creates a topic but never checks it appears
test_ucp_preferences html element exists Doesn't verify any RT-specific form fields

What the assertions should check

  • test_rt_page / test_rt_simple_page — RT block is present in the response; at minimum a known CSS class or language string rendered by the RT template
  • test_rt_page_disabled — the RT block is absent or a "disabled" state is shown
  • test_index_has_recent_topics — the created topic title appears inside the RT block on the index page
  • test_ucp_preferences — the UCP form contains the RT-specific fields (forum_recent_topics checkbox or equivalent)

Why this matters

The functional test suite currently gives false confidence. A broken template, a wrong config key, or a missing language string would all pass. Meaningful assertions make the suite worth running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions