Skip to content

Commit 035d367

Browse files
authored
PHPLIB-1037: Ensure EntityMap is set before invoking observer callable (#1001)
This handles the case where a test fails prior to Context initialization (e.g. while populating initial data).
1 parent 306739d commit 035d367

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/UnifiedSpecTests/UnifiedTestRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function run(UnifiedTestCase $test): void
125125
* succeeding or failing. Since the callable itself might throw, we
126126
* need to ensure doTearDown() will still be called. */
127127
try {
128-
if (isset($this->entityMapObserver)) {
128+
if (isset($this->entityMapObserver, $this->entityMap)) {
129129
call_user_func($this->entityMapObserver, $this->entityMap);
130130
}
131131
} finally {

0 commit comments

Comments
 (0)