From 5d5e7c95fe631be56da1209311335cd0932fa21c Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Tue, 14 Jun 2022 15:47:25 +0000
Subject: [PATCH] adjust test and cast i18n objects to string, fixes #1164

Closes #1164

Merge request studip/studip!693
---
 lib/classes/JsonApi/Schemas/InstituteMember.php | 2 +-
 tests/jsonapi/InstitutesMembershipShowTest.php  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/classes/JsonApi/Schemas/InstituteMember.php b/lib/classes/JsonApi/Schemas/InstituteMember.php
index 6777a2344c4..76ae9f97f50 100644
--- a/lib/classes/JsonApi/Schemas/InstituteMember.php
+++ b/lib/classes/JsonApi/Schemas/InstituteMember.php
@@ -21,7 +21,7 @@ class InstituteMember extends SchemaProvider
     public function getAttributes($resource, ContextInterface $context): iterable
     {
         $defaultNull = function ($key) use ($resource) {
-            return $resource->$key ?: null;
+            return (string) $resource->$key ?: null;
         };
 
         $attributes = [
diff --git a/tests/jsonapi/InstitutesMembershipShowTest.php b/tests/jsonapi/InstitutesMembershipShowTest.php
index c932945b4cc..03d99d7f2e8 100644
--- a/tests/jsonapi/InstitutesMembershipShowTest.php
+++ b/tests/jsonapi/InstitutesMembershipShowTest.php
@@ -23,7 +23,7 @@ class InstitutesMembershipShowTest extends \Codeception\Test\Unit
     public function testShouldShowMemberships()
     {
         $credentials = $this->tester->getCredentialsForTestDozent();
-        $membershipId = '205f3efb7997a0fc9755da2b535038da_2560f7c7674942a7dce8eeb238e15d93';
+        $membershipId = '1';
 
         $app = $this->tester->createApp($credentials, 'get', '/institute-memberships/{id}', InstituteMembershipsShow::class);
 
-- 
GitLab