You are here

public function FlattenExceptionTest::testFlattenHttpException in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php \Symfony\Component\Debug\Tests\Exception\FlattenExceptionTest::testFlattenHttpException()

@dataProvider flattenDataProvider

File

vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php, line 107

Class

FlattenExceptionTest

Namespace

Symfony\Component\Debug\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
    ->assertInstanceOf($flattened
    ->getClass(), $exception, 'The class is set to the class of the original exception');
}