BetterReflectionTest\Reflector\Exception\ParseToAstFailureTest::testFromLocatedSourceWithFilename PHP Метод

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

    public function testFromLocatedSourceWithFilename()
    {
        $locatedSource = new LocatedSource('<?php abc', null);
        $filenameProperty = new \ReflectionProperty($locatedSource, 'filename');
        $filenameProperty->setAccessible(true);
        $filenameProperty->setValue($locatedSource, '/foo/bar');
        $previous = new \Exception();
        $exception = ParseToAstFailure::fromLocatedSource($locatedSource, $previous);
        $this->assertInstanceOf(ParseToAstFailure::class, $exception);
        $this->assertSame('AST failed to parse in located source (in /foo/bar)', $exception->getMessage());
        $this->assertSame($previous, $exception->getPrevious());
    }