* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector; use PHPUnit\Framework\TestCase; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class ExceptionDataCollectorTest extends TestCase { public function testCollect() { $e = new \Exception('foo', 500); $c = new ExceptionDataCollector(); $flattened = FlattenException::create($e); $trace = $flattened->getTrace(); $this->assertFalse($c->hasException()); $c->collect(new Request(), new Response(), $e); $this->assertTrue($c->hasException()); $this->assertEquals($flattened, $c->getException()); $this->assertSame('foo', $c->getMessage()); $this->assertSame(500, $c->getCode()); $this->assertSame('exception', $c->getName()); $this->assertSame($trace, $c->getTrace()); } public function testCollectWithoutException() { $c = new ExceptionDataCollector(); $c->collect(new Request(), new Response()); $this->assertFalse($c->hasException()); } public function testReset() { $c = new ExceptionDataCollector(); $c->collect(new Request(), new Response(), new \Exception()); $c->reset(); $c->collect(new Request(), new Response()); $this->assertFalse($c->hasException()); } } __halt_compiler();----SIGNATURE:----a6vzj0u393A5zSWuFllUaxmV8tu4m9uk6Q4Rumo/CeqNdrb3/uqQM3DHbb5IfnmUXSAyzJLwiyRD/gjbscGefTy34G8du1ooP3SHxunqT8w2qjZ1VgSy2P2qFmvjnBTfx/5xoqUUlaIob3MAL7F4ic4zzHB+okxsxfIJEeTNE36fqKforIkZ9jVJVkMmYYywDUlWgwofhu9o4AvQoHWOkRiytuQDa+Ciluv+n+3orNH6u2RP0PkxNLsHRToM7bPL/ll650V+/UjwO13rjf6/7RmsgipsH6Jl3fzPrZ4JaVKWs3esbe2o6eAmCqkWAcKOIRilGzSS3TvuCP4PcAHHrzH/J80eZflUYHzcg/lKQe1w70joJTMekWSerk3erhzaFRZJNGOEHUKSKdk+2tZdYyI6MRjEk2Xp07YPYmbRfShri0IBLiSWUVOG8AjtqrnYvZaTGzj8uBXyHadZiY+KmWlAiwOpZb0aZ3a5TkDJE00hgcEQlzHSCaYvqfEo+HH5s541cgUihkgtUuhE2XhRoYstOk2teAcjh032R5TNA1pao7jntHcRaRWH4eDo18G5D0lvFqHNw+y4+BDgWhSCEkDmhZKEu/GgdDyZr1s1CRnqBQXPl02oPDFNT3fxk+CpbFurej8KO0C8RvFc6SUlgUAvzRWXWZYZsltMPBN5PDc=----ATTACHMENT:----MjA4NDc0MjQyMDAwNDk1IDk3MzgyNTEzMzkxOTQ2NTQgMjM2ODA3Njg1MDg1MDE4Mw==