Skip to content

Rename 'printLastResponseOnError' and settle Behat hook method naming #251

Description

@AlexSkrypnyk

Deferred from the codebase convergence work. Every fix here renames or reshapes a published symbol of this library, so it is a backward-compatibility break and was deliberately left out of the non-breaking follow-up.

Summary

printLastResponseOnError() does not print anything. It saves an HTML and an image screenshot when a step fails. The name is a leftover and actively misleads anyone reading the class.

Details

The docblock was corrected to describe the real behaviour, but the method name itself is public API and could not be changed without a break.

The hook methods also follow three different naming shapes:

Shape Methods
phase-prefixed beforeScenarioCheckScreenshotsTag, beforeScenarioInit, beforeStepInit, afterScenarioAnimate
phase-suffixed captureScreenshotAfterStep
phase-absent, and misnamed printLastResponseOnError

Phase-prefixed has a clear majority. Renaming printLastResponseOnError is the highest-value item here: it is the only name in the codebase that states something the method does not do.

All six are public methods on a class consumers extend, so any rename is a break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions