Documentation

DNFTypesParseError2Test extends AbstractTokenizerTestCase
in package

FinalYes

Table of Contents

Properties

$fileExtension  : string
The file extension of the test case file (without leading dot).
$phpcsFile  : File
The \PHP_CodeSniffer\Files\File object containing the parsed contents of the test case file.
$tabWidth  : int
The tab width setting to use when tokenizing the file.

Methods

clearResolvedTokensCache()  : void
Clear the static "resolved tokens" cache property on the Tokenizer\PHP class.
dataBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched()  : array<string, array<string, string>>
Data provider.
dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens()  : array<string, array<string, string>>
Data provider.
dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens()  : array<string, array<string, string>>
Data provider.
testBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched()  : void
Document handling for a DNF type / parse error where the type declaration contains an unmatched parenthesis, but also contains a set of matched parentheses.
testBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens()  : void
Document handling for a DNF type / parse error where the type declaration contains an unmatched parenthesis.
testBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens()  : void
Document handling for a DNF type / parse error where the type declaration contains an unmatched parenthesis.
getTargetToken()  : int
Get the token pointer for a target token based on a specific comment found on the line before.
initializeFile()  : void
Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file.

Properties

$fileExtension

The file extension of the test case file (without leading dot).

protected string $fileExtension = 'inc'

This allows child classes to overrule the default inc with, for instance, js or css when applicable.

$phpcsFile

The \PHP_CodeSniffer\Files\File object containing the parsed contents of the test case file.

protected File $phpcsFile

$tabWidth

The tab width setting to use when tokenizing the file.

protected int $tabWidth = 4

This allows for test case files to use a different tab width than the default.

Methods

clearResolvedTokensCache()

Clear the static "resolved tokens" cache property on the Tokenizer\PHP class.

public static clearResolvedTokensCache() : void

This method should be used selectively by tests to ensure the code under test is actually hit by the test testing the code.

dataBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched()

Data provider.

public static dataBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched() : array<string, array<string, string>>
Tags
see
testBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched()
Return values
array<string, array<string, string>>

dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens()

Data provider.

public static dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens() : array<string, array<string, string>>
Tags
see
testBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens()
Return values
array<string, array<string, string>>

dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens()

Data provider.

public static dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens() : array<string, array<string, string>>
Tags
see
testBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens()
Return values
array<string, array<string, string>>

testBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched()

Document handling for a DNF type / parse error where the type declaration contains an unmatched parenthesis, but also contains a set of matched parentheses.

public testBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched(string $testMarker) : void
Parameters
$testMarker : string

The comment prefacing the target token.

Tags
dataProvider

dataBrokenDNFTypeParensShouldAlwaysBeAPairMatchedAndUnmatched

covers

testBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens()

Document handling for a DNF type / parse error where the type declaration contains an unmatched parenthesis.

public testBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens(string $testMarker) : void
Parameters
$testMarker : string

The comment prefacing the target token.

Tags
dataProvider

dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingCloseParens

covers

testBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens()

Document handling for a DNF type / parse error where the type declaration contains an unmatched parenthesis.

public testBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens(string $testMarker) : void
Parameters
$testMarker : string

The comment prefacing the target token.

Tags
dataProvider

dataBrokenDNFTypeParensShouldAlwaysBeAPairMissingOpenParens

covers

getTargetToken()

Get the token pointer for a target token based on a specific comment found on the line before.

protected getTargetToken(string $commentString, int|string|array<string|int, mixed> $tokenType[, string $tokenContent = null ]) : int

Note: the test delimiter comment MUST start with "/* test" to allow this function to distinguish between comments used in a test and test delimiters.

Parameters
$commentString : string

The delimiter comment to look for.

$tokenType : int|string|array<string|int, mixed>

The type of token(s) to look for.

$tokenContent : string = null

Optional. The token content for the target token.

Return values
int

initializeFile()

Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file.

protected initializeFile() : void

The test case file for a unit test class has to be in the same directory directory and use the same file name as the test class, using the .inc extension.

Tags
before

        
On this page

Search results