diff --git a/lib/classes/JsonApi/Schemas/InstituteMember.php b/lib/classes/JsonApi/Schemas/InstituteMember.php index 6777a2344c4a354ffcea57c76463b2cb0706f949..76ae9f97f501304a06435452cf8886837827366a 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 c932945b4cceef25f29ea8a7f93903edfeccfe03..03d99d7f2e89b73bb839aadae1f69cd423da2811 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);