diff --git a/tests/process_error_test.php b/tests/process_error_test.php index 49259054..f8f19858 100644 --- a/tests/process_error_test.php +++ b/tests/process_error_test.php @@ -110,11 +110,10 @@ public function test_process_error_in_table(): void { $record = reset($records); $this->assertEquals($this->course->id, $record->courseid); - if (version_compare(PHP_VERSION, '8.0', '<')) { - $this->assertStringContainsString("Trying to get property 'id' of non-object", $record->errormessage); - } else { - $this->assertStringContainsString("Attempt to read property \"id\" on bool", $record->errormessage); - } + // We may not know the exact error message. + // For example, if there are other plugins that implement the pre_course_delete hook, + // We will get different error messages, when those plugin trying to access course modules. + $this->assertNotEmpty($record->errormessage); $this->assertEquals($process->id, $record->id); }