BetterReflectionTest\Reflector\LocatorTest::testFindReflectionsOfTypeThrowsParseToAstFailureExceptionWithInvalidCode PHP Method

testFindReflectionsOfTypeThrowsParseToAstFailureExceptionWithInvalidCode() public method

    public function testFindReflectionsOfTypeThrowsParseToAstFailureExceptionWithInvalidCode()
    {
        $locator = new Locator();
        $phpCode = '<?php syntax error';
        $identifierType = new IdentifierType(IdentifierType::IDENTIFIER_CLASS);
        $sourceLocator = new StringSourceLocator($phpCode);
        $reflector = new ClassReflector($sourceLocator);
        $locatedSource = new LocatedSource($phpCode, null);
        $this->expectException(ParseToAstFailure::class);
        $locator->findReflectionsOfType($reflector, $locatedSource, $identifierType);
    }