diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index 1a50dd9b18290..b421112f16b75 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -85,10 +85,6 @@ public function __construct( if ($getter === 'getMentions') { continue; // special treatment } - if ($getter === 'getMetaData') { - // Array can not be handled at the moment in DAV - continue; - } $name = '{'.self::NS_OWNCLOUD.'}' . lcfirst(substr($getter, 3)); $this->properties[$name] = $getter; diff --git a/apps/dav/tests/unit/Comments/CommentsNodeTest.php b/apps/dav/tests/unit/Comments/CommentsNodeTest.php index 15c207eafbd89..f9a6e872b8055 100644 --- a/apps/dav/tests/unit/Comments/CommentsNodeTest.php +++ b/apps/dav/tests/unit/Comments/CommentsNodeTest.php @@ -405,6 +405,11 @@ public function testGetProperties(): void { $ns . 'referenceId' => 'ref', $ns . 'isUnread' => null, $ns . 'reactions' => [], + $ns . 'metaData' => [ + 'last_edited_at' => 1702553770, + 'last_edited_by_id' => 'charly', + 'last_edited_by_type' => 'user', + ], $ns . 'expireDate' => new \DateTime('2016-01-12 19:00:00'), ]; @@ -475,6 +480,10 @@ public function testGetProperties(): void { ->method('getReferenceId') ->willReturn($expected[$ns . 'referenceId']); + $this->comment->expects($this->once()) + ->method('getMetaData') + ->willReturn($expected[$ns . 'metaData']); + $this->comment->expects($this->once()) ->method('getExpireDate') ->willReturn($expected[$ns . 'expireDate']); @@ -494,7 +503,7 @@ public function testGetProperties(): void { $properties = $this->node->getProperties(null); foreach ($properties as $name => $value) { - $this->assertArrayHasKey($name, $expected); + $this->assertArrayHasKey($name, $expected, 'Key not found in the list of $expected'); $this->assertSame($expected[$name], $value); unset($expected[$name]); }