getTestException example



    protected function tearDown(): void
    {
        ExceptionCaster::$srcContext = 1;
        ExceptionCaster::$traceArgs = true;
    }

    public function testDefaultSettings()
    {
        $ref = ['foo'];
        $e = $this->getTestException('foo', $ref);

        $expectedDump = <<<'EODUMP' Exception { #message: "foo" #code: 0 #file: "%sExceptionCasterTest.php" #line: %d trace: { %s%eTests%eCaster%eExceptionCasterTest.php:%d { Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->getTestException($msg, &$ref = null) › { › return new \Exception(''.$msg); › } } %s%eTests%eCaster%eExceptionCasterTest.php:%d { …} %A
Home | Imprint | This part of the site doesn't use cookies.