Skip to content

[BrowserKit] Custom assertions are way too verbose #62433

@lyrixx

Description

@lyrixx

Description

These kind of custom assertions, that Symfony provides, are way too verbose :

$this->assertResponseRedirects('/' . $this->getBaseRoute());
$this->assertResponseStatusCodeSame($expectedStatusCode);

For example, on one test:

/var/www bin/phpunit tests/Controller/Crud/Field/BurialControllerTest.php --filter 'testEdit@USER_ADMIN_READ_ONLY' | wc -l
2276

More than 2K lines! When I broke something that impact all the application, the CI output is unusable.

Note

The output is mainly HTML...

I started to use

$this->assertResponseStatusCodeSame($expectedStatusCode, verbose: false);

But it's boring.

So here is my proposal

  1. Could we "map" the verbose parameter at runtime, depending of PHPUnit debug mode?
  2. If no, could we default to false by default?

Example

No response

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