feature #22838 Make the simple exception pages match the new style (javiereguiluz)

This PR was squashed before being merged into the 3.3 branch (closes #22838).

Discussion
----------

Make the simple exception pages match the new style

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

If you create an application with Symfony Flex and don't install the TwigBundle explicitly, you see the exception pages like this:

![before](https://cloud.githubusercontent.com/assets/73419/26286531/3737f41c-3e68-11e7-8f1f-d9454bbc81f2.png)

This PR updates that page to match the style of the rest of exceptions:

![after](https://cloud.githubusercontent.com/assets/73419/26286534/488a2e4c-3e68-11e7-9d9e-8af8a478ff44.png)

For comparison, this is how the full exception page looks:

![full-exception](https://cloud.githubusercontent.com/assets/73419/26286535/56d69f26-3e68-11e7-8068-8334f045a63d.png)

---

Should I add the small black top header with the Symfony logo too?

Commits
-------

bab4b9c23c Make the simple exception pages match the new style
This commit is contained in:
Fabien Potencier 2017-05-27 09:02:28 -07:00
commit a80348b228
2 changed files with 87 additions and 74 deletions

File diff suppressed because one or more lines are too long

View File

@ -39,8 +39,8 @@ class ExceptionHandlerTest extends TestCase
$handler->sendPhpResponse(new \RuntimeException('Foo'));
$response = ob_get_clean();
$this->assertContains('<h1>Whoops, looks like something went wrong.</h1>', $response);
$this->assertNotContains('<h2 class="block_exception clear_fix">', $response);
$this->assertContains('Whoops, looks like something went wrong.', $response);
$this->assertNotContains('<div class="trace trace-as-html">', $response);
$handler = new ExceptionHandler(true);
@ -48,8 +48,8 @@ class ExceptionHandlerTest extends TestCase
$handler->sendPhpResponse(new \RuntimeException('Foo'));
$response = ob_get_clean();
$this->assertContains('<h1>Whoops, looks like something went wrong.</h1>', $response);
$this->assertContains('<h2 class="block_exception clear_fix">', $response);
$this->assertContains('Whoops, looks like something went wrong.', $response);
$this->assertContains('<div class="trace trace-as-html">', $response);
}
public function testStatusCode()
@ -94,7 +94,7 @@ class ExceptionHandlerTest extends TestCase
$handler->sendPhpResponse(new \RuntimeException('Foo', 0, new \RuntimeException('Bar')));
$response = ob_get_clean();
$this->assertStringMatchesFormat('%A<span class="exception_message">Foo</span>%A<span class="exception_message">Bar</span>%A', $response);
$this->assertStringMatchesFormat('%A<p class="break-long-words trace-message">Foo</p>%A<p class="break-long-words trace-message">Bar</p>%A', $response);
}
public function testHandle()