From 264aec674048b63aa9b0ac95344d9d8dbcd93326 Mon Sep 17 00:00:00 2001
From: Philipp Memmel <philipp.memmel@gmail.com>
Date: Thu, 27 Oct 2022 19:55:42 +0200
Subject: [PATCH] MBS-7081: Fix unit test error in process_error_test.php for
 PHP 8.0

---
 tests/process_error_test.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/process_error_test.php b/tests/process_error_test.php
index 5626b89..3298e10 100644
--- a/tests/process_error_test.php
+++ b/tests/process_error_test.php
@@ -109,7 +109,11 @@ class process_error_test extends \advanced_testcase {
         $record = reset($records);
 
         $this->assertEquals($this->course->id, $record->courseid);
-        $this->assertStringContainsString("Trying to get property 'id' of non-object", $record->errormessage);
+        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);
+        }
         $this->assertEquals($process->id, $record->id);
     }
 
-- 
GitLab