From d5f1cef6420c7450ce960f469fd10557ea8fcdd9 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 30 Oct 2017 15:10:21 +0100 Subject: 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 --- tests/lib/Comments/ManagerTest.php | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'tests/lib/Comments') 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')); -- cgit v1.2.3