StringErrorCodeException example


        return [
            [new \Exception('test', 123), 'Exception'],
            [new \Error('test', 123), 'Error'],
        ];
    }

    public static function stringAndIntDataProvider(): array
    {
        return [
            [new \Exception('test1', 123)],
            [new StringErrorCodeException('test2', '42S02')],
        ];
    }

    public function testAnonymousClass()
    {
        $flattened = FlattenException::createFromThrowable(new class() extends \RuntimeException {
        });

        $this->assertSame('RuntimeException@anonymous', $flattened->getClass());

        $flattened->setClass((new class('Oops') extends NotFoundHttpException {
        })
Home | Imprint | This part of the site doesn't use cookies.