use Symfony\Component\HttpKernel\Exception\PreconditionFailedHttpException;
use Symfony\Component\HttpKernel\Exception\PreconditionRequiredHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
class FlattenExceptionTest extends TestCase
{ public function testStatusCode() { $flattened = FlattenException::
createFromThrowable(new \
RuntimeException(), 403
);
$this->
assertEquals('403',
$flattened->
getStatusCode());
$flattened = FlattenException::
createFromThrowable(new \
RuntimeException());
$this->
assertEquals('500',
$flattened->
getStatusCode());
$flattened = FlattenException::
createFromThrowable(new \
DivisionByZeroError(), 403
);
$this->
assertEquals('403',
$flattened->
getStatusCode());
$flattened = FlattenException::
createFromThrowable(new \
DivisionByZeroError());
$this->
assertEquals('500',
$flattened->
getStatusCode());