PHP Class SqlParser\Tools\TestGenerator

Show file Open project: phpmyadmin/sql-parser Class Usage Examples

Public Methods

Method Description
build ( string $type, string $input, string $output, string $debug = null ) : void Builds a test.
buildAll ( string $input, string $output, $debug = null ) : void Generates recursively all tests preserving the directory structure.
generate ( string $query, string $type = 'parser' ) : array Generates a test's data.

Method Details

build() public static method

Reads the input file, generates the data and writes it back.
public static build ( string $type, string $input, string $output, string $debug = null ) : void
$type string The type of this test.
$input string The input file.
$output string The output file.
$debug string The debug file.
return void

buildAll() public static method

Generates recursively all tests preserving the directory structure.
public static buildAll ( string $input, string $output, $debug = null ) : void
$input string The input directory.
$output string The output directory.
return void

generate() public static method

Generates a test's data.
public static generate ( string $query, string $type = 'parser' ) : array
$query string The query to be analyzed.
$type string Test's type (may be `lexer` or `parser`).
return array