PhpUnitTestAnnotationFixer
extends AbstractPhpUnitFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isRisky() : mixed
- {@inheritdoc}
- applyPhpUnitClassFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- addTestAnnotation() : array<string|int, Line>
- addTestPrefix() : string
- addTestPrefixToDependsAnnotation() : Line
- applyTestAnnotation() : mixed
- applyTestPrefix() : mixed
- createDocBlock() : mixed
- doesDocBlockContainTest() : bool
- findWhereDependsFunctionNameStarts() : int
- Helps to find where the function name in the doc block starts.
- getSingleLineDocBlockEntry() : string
- hasProperTestAnnotation() : bool
- hasTestPrefix() : bool
- isMethod() : bool
- isTestMethod() : bool
- removeTestPrefix() : string
- removeTestPrefixFromDependsAnnotation() : Line
- splitUpDocBlock() : array<string|int, Line>
- Take a one line doc block, and turn it into a multi line doc block.
- updateDependsAnnotation() : Line
- Updates the depends tag on the current doc block.
- updateDocBlock() : array<string|int, Line>
- updateLines() : array<string|int, Line>
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NoEmptyPhpdocFixer, PhpUnitMethodCasingFixer, PhpdocTrimFixer.
Return values
mixed —isRisky()
{@inheritdoc}
public
isRisky() : mixed
Return values
mixed —applyPhpUnitClassFix()
{@inheritdoc}
protected
applyPhpUnitClassFix(Tokens $tokens, mixed $startIndex, mixed $endIndex) : mixed
Parameters
- $tokens : Tokens
- $startIndex : mixed
- $endIndex : mixed
Return values
mixed —createConfigurationDefinition()
{@inheritdoc}
protected
createConfigurationDefinition() : mixed
Return values
mixed —addTestAnnotation()
private
addTestAnnotation(array<string|int, Line> $lines, Tokens $tokens, int $docBlockIndex) : array<string|int, Line>
Parameters
Return values
array<string|int, Line> —addTestPrefix()
private
addTestPrefix(string $functionName) : string
Parameters
- $functionName : string
Return values
string —addTestPrefixToDependsAnnotation()
private
addTestPrefixToDependsAnnotation(Line $line) : Line
Parameters
- $line : Line
Return values
Line —applyTestAnnotation()
private
applyTestAnnotation(Tokens $tokens, int $startIndex, int $endIndex) : mixed
Parameters
- $tokens : Tokens
- $startIndex : int
- $endIndex : int
Return values
mixed —applyTestPrefix()
private
applyTestPrefix(Tokens $tokens, int $startIndex, int $endIndex) : mixed
Parameters
- $tokens : Tokens
- $startIndex : int
- $endIndex : int
Return values
mixed —createDocBlock()
private
createDocBlock(Tokens $tokens, int $docBlockIndex) : mixed
Parameters
- $tokens : Tokens
- $docBlockIndex : int
Return values
mixed —doesDocBlockContainTest()
private
doesDocBlockContainTest(DocBlock $doc) : bool
Parameters
- $doc : DocBlock
Return values
bool —findWhereDependsFunctionNameStarts()
Helps to find where the function name in the doc block starts.
private
findWhereDependsFunctionNameStarts(array<string|int, mixed> $line) : int
Parameters
- $line : array<string|int, mixed>
Return values
int —getSingleLineDocBlockEntry()
private
getSingleLineDocBlockEntry(array<string|int, Line> $lines) : string
Parameters
- $lines : array<string|int, Line>
Return values
string —hasProperTestAnnotation()
private
hasProperTestAnnotation(Tokens $tokens, int $index) : bool
Parameters
- $tokens : Tokens
- $index : int
Return values
bool —hasTestPrefix()
private
hasTestPrefix(string $functionName) : bool
Parameters
- $functionName : string
Return values
bool —isMethod()
private
isMethod(Tokens $tokens, int $index) : bool
Parameters
- $tokens : Tokens
- $index : int
Return values
bool —isTestMethod()
private
isTestMethod(Tokens $tokens, mixed $index) : bool
Parameters
- $tokens : Tokens
- $index : mixed
Return values
bool —removeTestPrefix()
private
removeTestPrefix(string $functionName) : string
Parameters
- $functionName : string
Return values
string —removeTestPrefixFromDependsAnnotation()
private
removeTestPrefixFromDependsAnnotation(Line $line) : Line
Parameters
- $line : Line
Return values
Line —splitUpDocBlock()
Take a one line doc block, and turn it into a multi line doc block.
private
splitUpDocBlock(array<string|int, Line> $lines, Tokens $tokens, int $docBlockIndex) : array<string|int, Line>
Parameters
Return values
array<string|int, Line> —updateDependsAnnotation()
Updates the depends tag on the current doc block.
private
updateDependsAnnotation(Line $line) : Line
Parameters
- $line : Line
Return values
Line —updateDocBlock()
private
updateDocBlock(Tokens $tokens, int $docBlockIndex) : array<string|int, Line>
Parameters
- $tokens : Tokens
- $docBlockIndex : int
Return values
array<string|int, Line> —updateLines()
private
updateLines(array<string|int, Line> $lines, Tokens $tokens, int $docBlockIndex) : array<string|int, Line>