PHP Class BetterReflectionTest\Reflection\ReflectionFunctionAbstractTest

Inheritance: extends PHPUnit_Framework_TestCase
Mostra file Open project: roave/better-reflection

Public Methods

Method Description
generatorProvider ( ) : array These generator tests were taken from nikic/php-parser - so a big thank you and credit to @nikic for this (and the awesome PHP-Parser library).
returnTypeFunctionProvider ( )
returnsReferenceProvider ( )
startEndLineProvider ( )
testAddParameter ( )
testCannotClone ( )
testExportThrowsException ( )
testGetAst ( )
testGetBodyAst ( )
testGetBodyCode ( )
testGetDocBlockReturnTypes ( )
testGetDocCommentWithComment ( )
testGetDocReturnsEmptyStringWithNoComment ( )
testGetFileName ( )
testGetLocatedSource ( )
testGetNumberOfParameters ( )
testGetParameter ( )
testGetParameterReturnsNullWhenNotFound ( )
testGetReturnStatementAstDoesNotGiveInnerScopeReturnStatements ( )
testGetReturnStatementAstReturnsStatements ( )
testGetReturnTypeReturnsNullWhenTypeIsNotDeclared ( )
testGetReturnTypeWithDeclaredType ( string $functionToReflect, string $expectedType )
testHasReturnTypeWhenTypeDeclared ( )
testHasReturnTypeWhenTypeIsNotDeclared ( )
testIsClosureWithClosure ( )
testIsClosureWithRegularFunction ( )
testIsDeprecated ( )
testIsGenerator ( string $php, boolean $expectingGenerator )
testIsGeneratorWhenNodeNotSet ( )
testIsInternal ( )
testIsVariadic ( string $php, boolean $expectingVariadic )
testNameMethodsWithClosure ( )
testNameMethodsWithNamespace ( )
testNameMethodsWithoutNamespace ( )
testPopulateFunctionAbstractThrowsExceptionWithInvalidNode ( )
testRemoveParameter ( )
testRemoveReturnType ( )
testReturnsReference ( string $php, boolean $expectingReturnsReference )
testSetBodyFromAst ( )
testSetBodyFromAstWithInvalidArgumentsThrowsException ( )
testSetBodyFromClosure ( )
testSetBodyFromString ( )
testSetBodyFromStringWithInvalidArgumentThrowsException ( )
testSetReturnType ( )
testStartEndLine ( string $php, integer $expectedStart, integer $expectedEnd )
variadicProvider ( )

Method Details

generatorProvider() public method

These generator tests were taken from nikic/php-parser - so a big thank you and credit to @nikic for this (and the awesome PHP-Parser library).
See also: https://github.com/nikic/PHP-Parser/blob/1.x/test/code/parser/stmt/function/generator.test
public generatorProvider ( ) : array
return array

returnTypeFunctionProvider() public method

returnsReferenceProvider() public method

startEndLineProvider() public method

testAddParameter() public method

public testAddParameter ( )

testCannotClone() public method

public testCannotClone ( )

testExportThrowsException() public method

testGetAst() public method

public testGetAst ( )

testGetBodyAst() public method

public testGetBodyAst ( )

testGetBodyCode() public method

public testGetBodyCode ( )

testGetDocBlockReturnTypes() public method

testGetDocCommentWithComment() public method

testGetDocReturnsEmptyStringWithNoComment() public method

testGetFileName() public method

public testGetFileName ( )

testGetLocatedSource() public method

testGetNumberOfParameters() public method

testGetParameter() public method

public testGetParameter ( )

testGetParameterReturnsNullWhenNotFound() public method

testGetReturnStatementAstDoesNotGiveInnerScopeReturnStatements() public method

testGetReturnStatementAstReturnsStatements() public method

testGetReturnTypeReturnsNullWhenTypeIsNotDeclared() public method

testGetReturnTypeWithDeclaredType() public method

public testGetReturnTypeWithDeclaredType ( string $functionToReflect, string $expectedType )
$functionToReflect string
$expectedType string

testHasReturnTypeWhenTypeDeclared() public method

testHasReturnTypeWhenTypeIsNotDeclared() public method

testIsClosureWithClosure() public method

testIsClosureWithRegularFunction() public method

testIsDeprecated() public method

public testIsDeprecated ( )

testIsGenerator() public method

public testIsGenerator ( string $php, boolean $expectingGenerator )
$php string
$expectingGenerator boolean

testIsGeneratorWhenNodeNotSet() public method

testIsInternal() public method

public testIsInternal ( )

testIsVariadic() public method

public testIsVariadic ( string $php, boolean $expectingVariadic )
$php string
$expectingVariadic boolean

testNameMethodsWithClosure() public method

testNameMethodsWithNamespace() public method

testNameMethodsWithoutNamespace() public method

testPopulateFunctionAbstractThrowsExceptionWithInvalidNode() public method

testRemoveParameter() public method

public testRemoveParameter ( )

testRemoveReturnType() public method

testReturnsReference() public method

public testReturnsReference ( string $php, boolean $expectingReturnsReference )
$php string
$expectingReturnsReference boolean

testSetBodyFromAst() public method

public testSetBodyFromAst ( )

testSetBodyFromAstWithInvalidArgumentsThrowsException() public method

testSetBodyFromClosure() public method

testSetBodyFromString() public method

testSetBodyFromStringWithInvalidArgumentThrowsException() public method

testSetReturnType() public method

public testSetReturnType ( )

testStartEndLine() public method

public testStartEndLine ( string $php, integer $expectedStart, integer $expectedEnd )
$php string
$expectedStart integer
$expectedEnd integer

variadicProvider() public method

public variadicProvider ( )