diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index ae77498539b..00065d49b17 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -41,7 +41,7 @@ class AddressBookImpl implements IAddressBookEnabled { * @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 74699cf3925..77b5db309df 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -53,7 +53,8 @@ class AddressBookImplTest extends TestCase { } public function testGetKey(): void { - $this->assertSame($this->addressBookInfo['id'], + $this->assertIsString($this->addressBookImpl->getKey()); + $this->assertSame((string)$this->addressBookInfo['id'], $this->addressBookImpl->getKey()); }