diff options
author | grnd-alt <github@belakkaf.net> | 2024-12-03 21:19:09 +0100 |
---|---|---|
committer | grnd-alt <github@belakkaf.net> | 2024-12-03 21:19:09 +0100 |
commit | eb61a3ae4480d8d07210e91fc2037e2887f9663e (patch) | |
tree | 50b8dc10c27f70e91b2921ce13ab33a265b24e3f /apps/files | |
parent | 8d953aeb8de809aab95371b2af1ef04e9d9d099f (diff) | |
download | nextcloud-server-eb61a3ae4480d8d07210e91fc2037e2887f9663e.tar.gz nextcloud-server-eb61a3ae4480d8d07210e91fc2037e2887f9663e.zip |
fix(tests): remove redundant unit test for activityfix/activity-log-for-favorites-in-dav
Signed-off-by: grnd-alt <github@belakkaf.net>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/tests/Service/TagServiceTest.php | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/apps/files/tests/Service/TagServiceTest.php b/apps/files/tests/Service/TagServiceTest.php index a05025e98e1..0e0149cc71b 100644 --- a/apps/files/tests/Service/TagServiceTest.php +++ b/apps/files/tests/Service/TagServiceTest.php @@ -9,9 +9,6 @@ namespace OCA\Files\Tests\Service; use OCA\Files\Service\TagService; use OCP\Activity\IManager; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Files\Events\NodeAddedToFavorite; -use OCP\Files\Events\NodeRemovedFromFavorite; use OCP\Files\Folder; use OCP\Files\NotFoundException; use OCP\ITags; @@ -43,9 +40,6 @@ class TagServiceTest extends \Test\TestCase { */ private $root; - /** @var IEventDispatcher|\PHPUnit\Framework\MockObject\MockObject */ - private $dispatcher; - /** * @var TagService|\PHPUnit\Framework\MockObject\MockObject */ @@ -74,7 +68,6 @@ class TagServiceTest extends \Test\TestCase { ->willReturn($user); $this->root = \OC::$server->getUserFolder(); - $this->dispatcher = $this->createMock(IEventDispatcher::class); $this->tagger = \OC::$server->getTagManager()->load('files'); $this->tagService = $this->getTagService(['addActivity']); @@ -108,9 +101,6 @@ class TagServiceTest extends \Test\TestCase { $tag1 = 'tag1'; $tag2 = 'tag2'; - $this->dispatcher->expects($this->never()) - ->method('dispatchTyped'); - $subdir = $this->root->newFolder('subdir'); $testFile = $subdir->newFile('test.txt'); $testFile->putContent('test contents'); @@ -144,34 +134,4 @@ class TagServiceTest extends \Test\TestCase { $subdir->delete(); } - - public function testFavoriteActivity(): void { - $subdir = $this->root->newFolder('subdir'); - $file = $subdir->newFile('test.txt'); - - $invokedCount = $this->exactly(2); - - $this->dispatcher->expects($invokedCount) - ->method('dispatchTyped') - ->willReturnCallback(function ($event) use ($invokedCount, $file) { - if ($invokedCount->getInvocationCount() === 1) { - $this->assertInstanceOf(NodeAddedToFavorite::class, $event); - } - if ($invokedCount->getInvocationCount() === 2) { - $this->assertInstanceOf(NodeRemovedFromFavorite::class, $event); - } - $this->assertEquals($this->userSession->getUser()->getUID(), $event->getUser()->getUID()); - $this->assertEquals('subdir/test.txt', $event->getPath()); - $this->assertEquals($file->getId(), $event->getFileId()); - }); - - // set tags - $this->tagService->updateFileTags('subdir/test.txt', [ITags::TAG_FAVORITE]); - - // remove tag - $this->tagService->updateFileTags('subdir/test.txt', []); - - - $subdir->delete(); - } } |