19declare(strict_types=1);
30use PHPUnit\Framework\TestCase;
38 PathFactory $path_factory,
45 protected function buildPathFromSteps(array $steps,
bool $is_relative,
bool $leads_to_exactly_one):
PathInterface
47 return $this->path_conditions_collection_test->getMockPath($steps, $is_relative, $leads_to_exactly_one);
54 return new class ($name) extends
NullStep {
72 bool $leads_exactly_to_one
74 return new class ($steps, $is_relative, $leads_exactly_to_one) extends
NullPath {
79 protected array $steps,
80 protected bool $is_relative,
81 protected bool $leads_exactly_to_one
85 public function isRelative(): bool
87 return $this->is_relative;
90 public function leadsToExactlyOneElement(): bool
92 return $this->leads_exactly_to_one;
95 public function steps(): \Generator
97 yield
from $this->steps;
103 foreach ($this->steps as $step) {
104 $step_string .=
'/' . ($step->name() instanceof
StepToken ? $step->name()->value : $step->name());
113 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
115 $this->getMockStep(
'general'),
116 $this->getMockStep(
'keyword'),
117 $this->getMockStep(
'string')
123 '/general/keyword/string',
124 $path_conditions->getPathWithoutConditions()->toString(),
128 $path_conditions->getConditionPathByStepName(
'general')->toString(),
132 $path_conditions->getConditionPathByStepName(
'keyword')->toString(),
136 $path_conditions->getConditionPathByStepName(
'string')->toString(),
140 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
146 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
153 $path_conditions->getPathWithoutConditions()->toString(),
157 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
163 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
165 $this->getMockStep(
'start'),
166 $this->getMockStep(
'step_1'),
167 $this->getMockStep(
'condition'),
168 $this->getMockStep(
'nested_condition'),
171 $this->getMockStep(
'target')
177 '/start/step_1/target',
178 $path_conditions->getPathWithoutConditions()->toString(),
182 $path_conditions->getConditionPathByStepName(
'start')->toString(),
185 '/condition/nested_condition/^/^',
186 $path_conditions->getConditionPathByStepName(
'step_1')->toString(),
190 $path_conditions->getConditionPathByStepName(
'target')->toString(),
194 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
200 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
202 $this->getMockStep(
'start'),
203 $this->getMockStep(
'step_1'),
204 $this->getMockStep(
'condition'),
205 $this->getMockStep(
'nested_condition'),
206 $this->getMockStep(
'nested_nested_condition'),
210 $this->getMockStep(
'target')
216 '/start/step_1/target',
217 $path_conditions->getPathWithoutConditions()->toString(),
221 $path_conditions->getConditionPathByStepName(
'start')->toString(),
224 '/condition/nested_condition/nested_nested_condition/^/^/^',
225 $path_conditions->getConditionPathByStepName(
'step_1')->toString(),
229 $path_conditions->getConditionPathByStepName(
'target')->toString(),
233 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
239 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
241 $this->getMockStep(
'start'),
242 $this->getMockStep(
'step_1'),
243 $this->getMockStep(
'condition'),
245 $this->getMockStep(
'target')
251 '/start/step_1/target',
252 $path_conditions->getPathWithoutConditions()->toString(),
256 $path_conditions->getConditionPathByStepName(
'start')->toString(),
260 $path_conditions->getConditionPathByStepName(
'step_1')->toString(),
264 $path_conditions->getConditionPathByStepName(
'target')->toString(),
268 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
274 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
276 $this->getMockStep(
'start'),
277 $this->getMockStep(
'step_1'),
278 $this->getMockStep(
'condition_1'),
280 $this->getMockStep(
'step_2'),
281 $this->getMockStep(
'condition_2'),
283 $this->getMockStep(
'condition_3'),
285 $this->getMockStep(
'target')
291 '/start/step_1/step_2/target',
292 $path_conditions->getPathWithoutConditions()->toString(),
296 $path_conditions->getConditionPathByStepName(
'start')->toString(),
300 $path_conditions->getConditionPathByStepName(
'step_1')->toString(),
303 '/condition_2/^/condition_3/^',
304 $path_conditions->getConditionPathByStepName(
'step_2')->toString(),
308 $path_conditions->getConditionPathByStepName(
'target')->toString(),
312 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
318 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
320 $this->getMockStep(
'start'),
321 $this->getMockStep(
'condition_1'),
322 $this->getMockStep(
'nested_condition_1'),
325 $this->getMockStep(
'step_1'),
326 $this->getMockStep(
'condition_2'),
328 $this->getMockStep(
'step_2'),
329 $this->getMockStep(
'condition_3'),
331 $this->getMockStep(
'condition_4'),
332 $this->getMockStep(
'nested_condition_4'),
333 $this->getMockStep(
'nested_nested_condition_4'),
337 $this->getMockStep(
'target')
343 '/start/step_1/step_2/target',
344 $path_conditions->getPathWithoutConditions()->toString(),
347 '/condition_1/nested_condition_1/^/^',
348 $path_conditions->getConditionPathByStepName(
'start')->toString(),
352 $path_conditions->getConditionPathByStepName(
'step_1')->toString(),
355 '/condition_3/^/condition_4/nested_condition_4/nested_nested_condition_4/^/^/^',
356 $path_conditions->getConditionPathByStepName(
'step_2')->toString(),
360 $path_conditions->getConditionPathByStepName(
'target')->toString(),
364 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
370 $path_conditions = $this->getPartiallyMockedPathConditionsCollection($this->getMockPath(
372 $this->getMockStep(
'start'),
373 $this->getMockStep(
'condition_1'),
374 $this->getMockStep(
'nested_condition_1'),
377 $this->getMockStep(
'step_1'),
378 $this->getMockStep(
'condition_2'),
380 $this->getMockStep(
'step_2'),
381 $this->getMockStep(
'condition_3'),
383 $this->getMockStep(
'condition_4'),
384 $this->getMockStep(
'nested_condition_4'),
385 $this->getMockStep(
'nested_nested_condition_4'),
389 $this->getMockStep(
'target'),
390 $this->getMockStep(
'condition_5'),
391 $this->getMockStep(
'nested_condition_5'),
399 '/start/step_1/step_2/target',
400 $path_conditions->getPathWithoutConditions()->toString(),
403 '/condition_1/nested_condition_1/^/^',
404 $path_conditions->getConditionPathByStepName(
'start')->toString(),
408 $path_conditions->getConditionPathByStepName(
'step_1')->toString(),
411 '/condition_3/^/condition_4/nested_condition_4/nested_nested_condition_4/^/^/^',
412 $path_conditions->getConditionPathByStepName(
'step_2')->toString(),
415 '/condition_5/nested_condition_5/^/^',
416 $path_conditions->getConditionPathByStepName(
'target')->toString(),
420 $path_conditions->getConditionPathByStepName(
'not_a_step')->toString(),
__construct()
Constructor setup ILIAS global object @access public.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc