public function FlattenExceptionTest::testFlattenHttpException

@dataProvider flattenDataProvider

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php, line 41

Class

FlattenExceptionTest

Namespace

Symfony\Component\HttpKernel\Tests\Exception

Code

public function testFlattenHttpException(\Exception $exception, $statusCode) {
  $flattened = FlattenException::create($exception);
  $flattened2 = FlattenException::create($exception);
  $flattened
    ->setPrevious($flattened2);
  $this
    ->assertEquals($exception
    ->getMessage(), $flattened
    ->getMessage(), 'The message is copied from the original exception.');
  $this
    ->assertEquals($exception
    ->getCode(), $flattened
    ->getCode(), 'The code is copied from the original exception.');
  $this
    ->assertEquals(get_class($exception), $flattened
    ->getClass(), 'The class is set to the class of the original exception');
}