PHP Класс Psecio\Parse\Rule\RuleTestCase

Наследование: extends PHPUnit_Framework_TestCase
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$parser The parser to use to parse samples

Открытые методы

Метод Описание
assertParseTest ( mixed $expected, string $code, string $message = '' ) Assert that running $test against $code results in $expected
assertParseTestFalse ( string $code, string $message = '' ) Assert that parsing $code with buildTest()'s Test returns false
assertParseTestTrue ( string $code, string $message = '' ) Assert that parsing $code with buildTest()'s Test returns true
parseSampleProvider ( ) : array PHPUnit provider to provide samples and results
setUp ( ) Set up the parser the same way the Scanner does
testDescription ( )
testLongDescription ( )
testParseSample ( ) Run the tests supplied by {@see parseSampleProvider()}

Защищенные методы

Метод Описание
buildTest ( ) : Psecio\Parse\RuleInterface Method to create the test to evaluate
formatCodeForMessage ( string $code ) : string Format a code string so it displays nicely in an assertion message
scan ( string $code ) : boolean Scan PHP code and return the result

Описание методов

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

Note taht $message does not replace the message from the assertion, only augments it.
public assertParseTest ( mixed $expected, string $code, string $message = '' )
$expected mixed The expected result of the $test
$code string The PHP code to parse and evaulate
$message string Message to be displayed on failure

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

Assert that parsing $code with buildTest()'s Test returns false
public assertParseTestFalse ( string $code, string $message = '' )
$code string Code to test
$message string Message to display on failure

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

Assert that parsing $code with buildTest()'s Test returns true
public assertParseTestTrue ( string $code, string $message = '' )
$code string Code to test
$message string Message to display on failure

buildTest() абстрактный защищенный Метод

This should return an instantiated object of the class that is being evaluated
abstract protected buildTest ( ) : Psecio\Parse\RuleInterface
Результат Psecio\Parse\RuleInterface An object of the type being tested

formatCodeForMessage() защищенный Метод

Prefixes each line of the code with " > ".
protected formatCodeForMessage ( string $code ) : string
$code string The code to format
Результат string The formatted code

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

This method provides a list of samples and expected results that this unit test should test against. The structure should be: [ ['valid php code', ], [ ... ], ... ] Note that the actual test method prefixes the sample code with '
public parseSampleProvider ( ) : array
Результат array Lists of samples to test against

scan() защищенный Метод

Scan PHP code and return the result
protected scan ( string $code ) : boolean
$code string The code to scan
Результат boolean The results visiting all the nodes from the parsed $code

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

Set up the parser the same way the Scanner does
public setUp ( )

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

public testDescription ( )

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

public testLongDescription ( )

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

Run the tests supplied by {@see parseSampleProvider()}
public testParseSample ( )

Описание свойств

$parser защищенное свойство

The parser to use to parse samples
protected $parser