| Conditions | 7 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function test(ExampleStoreInterface $exampleStore, RunnerInterface $runner, bool $stopOnFailure): void |
||
| 22 | { |
||
| 23 | foreach ($runner->run($exampleStore) as $outcome) { |
||
| 24 | if ($outcome instanceof SkippedOutcome) { |
||
| 25 | $this->dispatcher->dispatch(new Event\EvaluationSkipped($outcome)); |
||
| 26 | continue; |
||
| 27 | } |
||
| 28 | |||
| 29 | $this->dispatcher->dispatch(new Event\EvaluationStarted($outcome)); |
||
| 30 | |||
| 31 | foreach ($this->evaluator->evaluate($outcome) as $status) { |
||
| 32 | $this->dispatcher->dispatch( |
||
| 33 | $status->isSuccess() ? new Event\TestPassed($status) : new Event\TestFailed($status) |
||
| 34 | ); |
||
| 35 | |||
| 36 | if ($stopOnFailure && !$status->isSuccess()) { |
||
| 37 | $this->dispatcher->dispatch(new Event\TestingAborted()); |
||
| 38 | break 2; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | $this->dispatcher->dispatch(new Event\EvaluationDone($outcome)); |
||
| 43 | } |
||
| 46 |