Skip to content

Refactor IsCamelCapsTest to use dataproviders #846

Open
@jrfnl

Description

@jrfnl

The PHP_CodeSniffer\Util\Common::isCamelCaps() method is fully covered by dedicated tests in the IsCamelCapsTest class, however, those tests don't comply with certain best practices:

  • Multiple assertions in each test method.
  • No failure description for assertions when a test contains multiple assertions.
  • Unrelated failing assertion can block other tests from running.

The short of it is that these tests could be improved by being refactored to simple test methods containing a single assertion in combination with data providers with descriptively named data sets.

As part of the refactor, a critical look at whether the test cases included are sufficient wouldn't be a bad thing, as code coverage doesn't tell the whole story.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions