Skip to content

[Cookbook] Clarify suggestions for Testing Commands #2514

Closed
@johnkary

Description

@johnkary

In the cookbook article How to create a Console Command there is a section on Testing Commands.

This section is a little vague on details and should be expanded upon to be a bit more friendly. Some ideas for improvement:

  1. Application should be used instead of Application: - This currently only links to the two separate classes and is very confusing on first read because you have to click each respective link to find out which one to NOT use. Instead detail which package each one is from and explain WHY this suggestion is being made.
  2. Reading that extending from WebTestCase was the best way to test my command is a bit weird. I think, "My Command has nothing to do with the web--why am I extending from a class called WebTestCase?" To me this sounds like Symfony\Bundle\FrameworkBundle\Test\WebTestCase should be renamed to something more generic like FunctionalTestCase.

I have opened a PR about renaming WebTestCase to FunctionalTestCase: symfony/symfony#7704

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsoleactionableClear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions