From 3fb8b00beeddc5ea1c26179b7237a35bba8d0b90 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Fri, 20 Sep 2024 12:59:51 +0200 Subject: [PATCH] test: Add tests for Events Signed-off-by: provokateurin --- ...GroupVersionsExpireDeleteFileEventTest.php | 20 ++++++++++++++ ...upVersionsExpireDeleteVersionEventTest.php | 27 +++++++++++++++++++ ...roupVersionsExpireEnterFolderEventTest.php | 20 ++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 tests/Event/GroupVersionsExpireDeleteFileEventTest.php create mode 100644 tests/Event/GroupVersionsExpireDeleteVersionEventTest.php create mode 100644 tests/Event/GroupVersionsExpireEnterFolderEventTest.php diff --git a/tests/Event/GroupVersionsExpireDeleteFileEventTest.php b/tests/Event/GroupVersionsExpireDeleteFileEventTest.php new file mode 100644 index 000000000..9d58a8864 --- /dev/null +++ b/tests/Event/GroupVersionsExpireDeleteFileEventTest.php @@ -0,0 +1,20 @@ +assertEquals(123, $event->fileId); + } +} diff --git a/tests/Event/GroupVersionsExpireDeleteVersionEventTest.php b/tests/Event/GroupVersionsExpireDeleteVersionEventTest.php new file mode 100644 index 000000000..aa00bf47e --- /dev/null +++ b/tests/Event/GroupVersionsExpireDeleteVersionEventTest.php @@ -0,0 +1,27 @@ +createMock(GroupVersion::class); + $version + ->expects($this->once()) + ->method('getFolderId') + ->willReturn(123); + + $event = new GroupVersionsExpireDeleteVersionEvent($version); + $this->assertEquals(123, $event->version->getFolderId()); + } +} diff --git a/tests/Event/GroupVersionsExpireEnterFolderEventTest.php b/tests/Event/GroupVersionsExpireEnterFolderEventTest.php new file mode 100644 index 000000000..65910a8ba --- /dev/null +++ b/tests/Event/GroupVersionsExpireEnterFolderEventTest.php @@ -0,0 +1,20 @@ + 'value']); + $this->assertEquals(['key' => 'value'], $event->folder); + } +}