Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! feat(comments): Add a meta data column fo…
Browse files Browse the repository at this point in the history
…r comments
  • Loading branch information
nickvergessen committed Dec 14, 2023
1 parent be8776b commit d18634c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 0 additions & 4 deletions apps/dav/lib/Comments/CommentNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 10 additions & 1 deletion apps/dav/tests/unit/Comments/CommentsNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
];

Expand Down Expand Up @@ -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']);
Expand All @@ -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]);
}
Expand Down

0 comments on commit d18634c

Please sign in to comment.