1 | <?php |
||
23 | final class Reader implements EnvironmentReader { |
||
24 | |||
25 | /** |
||
26 | * @var ContextReader[] |
||
27 | */ |
||
28 | private $contextReaders = array(); |
||
29 | |||
30 | /** |
||
31 | * Drupal driver manager. |
||
32 | * |
||
33 | * @var \Drupal\DrupalDriverManager |
||
34 | */ |
||
35 | private $drupal; |
||
36 | |||
37 | /** |
||
38 | * Configuration parameters for this suite. |
||
39 | */ |
||
40 | private $parameters; |
||
41 | |||
42 | /** |
||
43 | * Statically cached lists of subcontexts by path. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | static protected $subContexts; |
||
48 | |||
49 | /** |
||
50 | * Register the Drupal driver manager. |
||
51 | */ |
||
52 | public function __construct(DrupalDriverManager $drupal, array $parameters) { |
||
56 | |||
57 | /** |
||
58 | * Registers context loader. |
||
59 | * |
||
60 | * @param ContextReader $contextReader |
||
61 | */ |
||
62 | public function registerContextReader(ContextReader $contextReader) { |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function supportsEnvironment(Environment $environment) { |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function readEnvironmentCallees(Environment $environment) { |
||
104 | |||
105 | /** |
||
106 | * Reads callees from a specific suite's context. |
||
107 | * |
||
108 | * @param ContextEnvironment $environment |
||
109 | * @param string $contextClass |
||
110 | * |
||
111 | * @return Callee[] |
||
112 | */ |
||
113 | private function readContextCallees(ContextEnvironment $environment, $contextClass) |
||
125 | |||
126 | /** |
||
127 | * Finds and loads available subcontext classes. |
||
128 | */ |
||
129 | private function findSubContextClasses() { |
||
169 | |||
170 | /** |
||
171 | * Find Sub-contexts matching a given pattern located at the passed path. |
||
172 | * |
||
173 | * @param string $path |
||
174 | * Absolute path to the directory to search for sub-contexts. |
||
175 | * @param string $pattern |
||
176 | * File pattern to match. Defaults to `/^.+\.behat\.inc/i`. |
||
177 | * |
||
178 | * @return array |
||
179 | * An array of paths. |
||
180 | */ |
||
181 | private function findAvailableSubContexts($path, $pattern = '/^.+\.behat\.inc/i') { |
||
201 | |||
202 | /** |
||
203 | * Load each subcontext file. |
||
204 | * |
||
205 | * @param array $subcontexts |
||
206 | * An array of files to include. |
||
207 | */ |
||
208 | private function loadSubContexts($subcontexts) { |
||
218 | |||
219 | } |
||
220 |