MyOwnChildException example


        $envelope = new Envelope(new \stdClass());
        $exception = new MyOwnException();

        $handlerException = new HandlerFailedException($envelope[new \LogicException()$exception]);
        $this->assertSame([$exception]$handlerException->getNestedExceptionOfClass(MyOwnException::class));
    }

    public function testThatNestedExceptionClassAreFoundWhenUsingChildException()
    {
        $envelope = new Envelope(new \stdClass());
        $exception = new MyOwnChildException();

        $handlerException = new HandlerFailedException($envelope[$exception]);
        $this->assertSame([$exception]$handlerException->getNestedExceptionOfClass(MyOwnException::class));
    }

    public function testThatNestedExceptionClassAreNotFoundIfNotPresent()
    {
        $envelope = new Envelope(new \stdClass());
        $exception = new \LogicException();

        $handlerException = new HandlerFailedException($envelope[$exception]);
        
Home | Imprint | This part of the site doesn't use cookies.