class TestGenerator (View source)

Used for test generation.

Methods

static array
generate(string $query, string $type = 'parser')

Generates a test's data.

static 
build(string $type, string $input, string $output, string $debug = null, bool $ansi = false)

Builds a test.

static 
buildAll(string $input, string $output, mixed|null $debug = null)

Generates recursively all tests preserving the directory structure.

Details

static array generate(string $query, string $type = 'parser')

Generates a test's data.

Parameters

string $query the query to be analyzed
string $type test's type (may be lexer or parser)

Return Value

array

static build(string $type, string $input, string $output, string $debug = null, bool $ansi = false)

Builds a test.

Reads the input file, generates the data and writes it back.

Parameters

string $type the type of this test
string $input the input file
string $output the output file
string $debug the debug file
bool $ansi activate quotes ANSI mode

static buildAll(string $input, string $output, mixed|null $debug = null)

Generates recursively all tests preserving the directory structure.

Parameters

string $input the input directory
string $output the output directory
mixed|null $debug