Skip to content

Commit 27f6f4e

Browse files
committedSep 4, 2024
Dispatch finish event when returning early to allow for cleanup
1 parent c96a880 commit 27f6f4e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/ExerciseDispatcher.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ public function verify(ExerciseInterface $exercise, Input $input): ResultAggrega
125125
$this->results->add($check->check($context));
126126

127127
if (!$this->results->isSuccessful()) {
128+
$exercise->tearDown();
129+
$this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.finish', $context));
128130
return $this->results;
129131
}
130132
}

0 commit comments

Comments
 (0)
Please sign in to comment.