Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Debug][ExceptionHandler] Add tests for custom handlers #32619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 3.4
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

In #31694 I mixed many things but the whole PR was closed. I wrote some tests for custom handlers + the handle tests don't use mock anymore

I think they are useful even if the ExceptionHandler will disappear in the new component because it will still exists in 4.4 for the next 3 years.

@fancyweb fancyweb changed the base branch from 4.4 to 3.4 July 19, 2019 08:49
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Jul 19, 2019
@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

@nicolas-grekas nicolas-grekas merged commit c53e253 into symfony:3.4 Jul 23, 2019
nicolas-grekas added a commit that referenced this pull request Jul 23, 2019
…(fancyweb)

This PR was merged into the 3.4 branch.

Discussion
----------

[Debug][ExceptionHandler] Add tests for custom handlers

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

In #31694 I mixed many things but the whole PR was closed. I wrote some tests for custom handlers + the handle tests don't use mock anymore

I think they are useful even if the `ExceptionHandler` will disappear in the new component because it will still exists in 4.4 for the next 3 years.

Commits
-------

c53e253 [Debug][ExceptionHandler] Add tests for custom handlers
@fancyweb fancyweb deleted the add-custom-exception-handler-tests branch July 23, 2019 08:41
private function assertThatTheExceptionWasOutput($content, $expectedClass, $expectedTitle, $expectedMessage)
{
$this->assertContains(sprintf('<span class="exception_title"><abbr title="%s">%s</abbr></span>', $expectedClass, $expectedTitle), $content);
$this->assertContains(sprintf('<p class="break-long-words trace-message">%s</p>', $expectedMessage), $content);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolas-grekas Use <h1 class="break-long-words exception-message"> when merging to 4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants