Skip to content

--testdox option doesn't format snake_case tests #2039

Closed
@adamwathan

Description

@adamwathan

Perhaps this is by design, but I've noticed that if I run PHPUnit with the --testdox flag when using snake_case test names, the test_ isn't stripped and the first letter of the test name isn't capitalized.

For example,

public function testMyMethodWorks() { ... }

...spits out:

[x] My method works

...but using snake case:

public function test_my_method_works() { ... }

...spits out:

[x] test my method works

Even using the @test annotation like so:

/** @test */
public function my_method_works() { ... }

...doesn't capitalize the first letter:

[x] my method works

Is this by design, and if so is there anywhere I can learn more about why it works this way? If not, it would be really cool to be able to use snake_case test names for the readability benefits, while still getting the nicely formatted testdox output that's achievable with camelCase test names.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions