-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparser.php
More file actions
79 lines (61 loc) · 2.02 KB
/
parser.php
File metadata and controls
79 lines (61 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
$root = isset($argv[1]) ? $argv[1] : '';
require $root . '/vendor/autoload.php';
require __DIR__ . '/vendor/autoload.php';
function loadBehat($root)
{
define('BEHAT_BIN_PATH', $root);
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) {
require $autoload;
}
if (!class_exists('Behat\Behat\ApplicationFactory', true)) {
if (is_file($autoload = __DIR__ . '/../vendor/autoload.php')) {
require($autoload);
} elseif (is_file($autoload = __DIR__ . '/../../../autoload.php')) {
require($autoload);
} else {
fwrite(STDERR,
'You must set up the project dependencies, run the following commands:'.PHP_EOL.
'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
'php composer.phar install'.PHP_EOL
);
exit(1);
}
}
$factory = new \Behat\Behat\ApplicationFactory();
$application = $factory->createApplication();
$application->getDefinition();
var_dump($application);
}
loadBehat($root);
// use \BehatParser\Parser;
// use \BehatParser\Matcher;
// $search = isset($argv[2]) ? $argv[2] : '';
// $behat_parser_library = new Parser();
// function getAllClasses() {
// $classes = get_declared_classes();
// echo count($classes);
// exit();
// foreach ($classes as $class)
// {
// if ($ci = class_implements($class)) {
// echo print_r($ci);
// }
// }
// return [];
// }
// $classes = getAllClasses();
// $behat_parser_library->readClassesForStepDefinitions($classes);
// $matcher = new Matcher($behat_parser_library);
// if (!empty($search)) {
// $matching_result = $matcher->findStepContaining($search);
// }
// else {
// $matching_result = $behat_parser_library->getAllStepDefinitions();
// }
// foreach ($matching_result as &$step) {
// $step = trim(str_replace(['Given', 'When', 'Then', 'But', 'And'], '', $step));
// }
// unset($step);
// $available_steps = array_unique($matching_result);
// echo json_encode($available_steps);