diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index fd42447f0e539..186f81d172d25 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -66,7 +66,7 @@ public function __construct( * @since 5.0.0 */ public function getKey() { - return $this->addressBookInfo['id']; + return (string) $this->addressBookInfo['id']; } /** diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index 038bc0274d9dc..f9563991af23a 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -67,7 +67,8 @@ protected function setUp(): void { } public function testGetKey(): void { - $this->assertSame($this->addressBookInfo['id'], + $this->assertIsString($this->addressBookImpl->getKey()); + $this->assertSame((string) $this->addressBookInfo['id'], $this->addressBookImpl->getKey()); }