Kraken\_Unit\Throwable\ThrowableProxyTest::testApiConstructor_CreatesInstance_WithPreviousElementBeingError PHP Метод

testApiConstructor_CreatesInstance_WithPreviousElementBeingError() публичный Метод

    public function testApiConstructor_CreatesInstance_WithPreviousElementBeingError()
    {
        $prev = new Error('Previous');
        $ex = new Error('Error', 0, $prev);
        $proxy = $this->createThrowableProxy($ex);
        $throwable = $proxy->toThrowable();
        $this->assertInstanceOf(Error::class, $throwable);
        $this->assertSame('Error', $throwable->getMessage());
        $throwable = $throwable->getPrevious();
        $this->assertInstanceOf(Error::class, $throwable);
        $this->assertSame('Previous', $throwable->getMessage());
    }