Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tests fail because expected exceptions are intercepted by ExceptionController #33478

Copy link
Copy link
Closed
@derrabus

Description

@derrabus
Issue body actions

Symfony version(s) affected: 4.4-dev

Description
#33271 introduced an error controller that renders error pages for exceptions. Before that, TwigBundle rendered error pages and if that bundle was missing, the exception bubbled up to the code that called Kernel::handle().

The new behavior might be more consistent, however it breaks tests that relied on the old behvior, like this one from SecurityBundle 4.3:

public function testUserProviderIsNeeded()
{
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
$this->expectExceptionMessage('"default" firewall requires a user provider but none was defined.');
$client = $this->createClient(['test_case' => 'MissingUserProvider', 'root_config' => 'config.yml']);
$client->request('GET', '/', [], [], [
'PHP_AUTH_USER' => 'username',
'PHP_AUTH_PW' => 'pa$$word',
]);
}

The test fails if FrameworkBundle 4.4 is installed and if I downgrade FrameworkBundle to 4.3, the test is green.

PR #33271 patches the test on the 4.4 branch to parse the error page instead of catching the exception, but we cannot do that on 4.3 because then the test would not work with FrameworkBundle 4.3 anymore.

Also, this kind of looks like a BC break to me. Userland tests might run into similar issues.

ping @yceruto

How to reproduce
https://travis-ci.org/symfony/symfony/jobs/580647626

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.