Skip to content

Commit

Permalink
PHPLIB-1037: Ensure EntityMap is set before invoking observer callable (
Browse files Browse the repository at this point in the history
#1001)

This handles the case where a test fails prior to Context initialization (e.g. while populating initial data).
  • Loading branch information
jmikola committed Nov 3, 2022
1 parent 306739d commit 035d367
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/UnifiedSpecTests/UnifiedTestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function run(UnifiedTestCase $test): void
* succeeding or failing. Since the callable itself might throw, we
* need to ensure doTearDown() will still be called. */
try {
if (isset($this->entityMapObserver)) {
if (isset($this->entityMapObserver, $this->entityMap)) {
call_user_func($this->entityMapObserver, $this->entityMap);
}
} finally {
Expand Down

0 comments on commit 035d367

Please sign in to comment.