summaryrefslogtreecommitdiffstats
path: root/tests/lib/Comments
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-10-30 15:10:21 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-10-30 15:59:43 +0100
commitd5f1cef6420c7450ce960f469fd10557ea8fcdd9 (patch)
treecdc3245e7dd4e1bb280093ff56701b52383d7bcf /tests/lib/Comments
parent61db8615f4921c12c4c7090e87701b1bdbb2c186 (diff)
downloadnextcloud-server-d5f1cef6420c7450ce960f469fd10557ea8fcdd9.tar.gz
nextcloud-server-d5f1cef6420c7450ce960f469fd10557ea8fcdd9.zip
fix comment sorter
background: we have a flat hierarchy of comments, not a tree. therefore we can also remove again the unnecessary additions. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests/lib/Comments')
-rw-r--r--tests/lib/Comments/ManagerTest.php31
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php
index df70581d6b4..671389232e2 100644
--- a/tests/lib/Comments/ManagerTest.php
+++ b/tests/lib/Comments/ManagerTest.php
@@ -253,37 +253,6 @@ class ManagerTest extends TestCase {
} while (count($comments) > 0);
}
- public function testGetActorsInTree() {
- $manager = $this->getManager();
-
- $headId = $this->addDatabaseEntry(0, 0);
-
- $id = $this->addDatabaseEntry($headId, $headId, new \DateTime('-3 hours'));
- $comment = $manager->get($id)->setActor('users', 'bob');
- $manager->save($comment);
-
- $this->addDatabaseEntry($headId, $headId, new \DateTime('-2 hours'));
- $this->addDatabaseEntry($headId, $headId, new \DateTime('-2 hours'));
-
- $id = $this->addDatabaseEntry($headId, $headId, new \DateTime('-1 hour'));
- $comment = $manager->get($id)->setActor('users', 'bob');
- $manager->save($comment);
-
- $id = $this->addDatabaseEntry($headId, $headId, new \DateTime('-4 hour'));
- $comment = $manager->get($id)->setActor('users', 'cynthia');
- $manager->save($comment);
-
- $actors = $manager->getActorsInTree($headId);
- $this->assertTrue(isset($actors['users']));
- $this->assertCount(3, $actors['users']);
- $this->assertTrue(isset($actors['users']['alice']));
- $this->assertTrue(isset($actors['users']['bob']));
- $this->assertTrue(isset($actors['users']['cynthia']));
- $this->assertSame(3, $actors['users']['alice']);
- $this->assertSame(2, $actors['users']['bob']);
- $this->assertSame(1, $actors['users']['cynthia']);
- }
-
public function testGetForObjectWithDateTimeConstraint() {
$this->addDatabaseEntry(0, 0, new \DateTime('-6 hours'));
$this->addDatabaseEntry(0, 0, new \DateTime('-5 hours'));