From 4c041177e1a2120cf821cd346f79864e6b57b03f Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Tue, 11 Aug 2026 03:51:43 -0700 Subject: [PATCH 1/2] fix: clarify trashbin expiration CLI help Fixes #45418 --- .../lib/Command/ExpireTrash.php | 5 +++-- .../tests/Command/ExpireTrashTest.php | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index fdc8e058cbf91..256be47750613 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -35,11 +35,12 @@ protected function configure(): void { parent::configure(); $this ->setName('trashbin:expire') - ->setDescription('Expires the users trashbin') + ->setDescription('Delete eligible trashbin entries according to the configured retention and space policy') + ->setHelp('Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.') ->addArgument( 'user_id', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, - 'expires the trashbin of the given user(s), if no user is given the trash for all users will be expired' + 'Limit processing to the given user ID(s); if no user ID is given, all users are processed' ); } diff --git a/apps/files_trashbin/tests/Command/ExpireTrashTest.php b/apps/files_trashbin/tests/Command/ExpireTrashTest.php index 55859da0557b3..092da2855eecd 100644 --- a/apps/files_trashbin/tests/Command/ExpireTrashTest.php +++ b/apps/files_trashbin/tests/Command/ExpireTrashTest.php @@ -66,6 +66,28 @@ protected function tearDown(): void { parent::tearDown(); } + public function testCommandMetadata(): void { + $command = new ExpireTrash( + Server::get(IUserManager::class), + $this->expiration, + Server::get(SetupManager::class), + Server::get(IRootFolder::class), + ); + + $this->assertSame( + 'Delete eligible trashbin entries according to the configured retention and space policy', + $command->getDescription(), + ); + $this->assertSame( + 'Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.', + $command->getHelp(), + ); + $this->assertSame( + 'Limit processing to the given user ID(s); if no user ID is given, all users are processed', + $command->getDefinition()->getArgument('user_id')->getDescription(), + ); + } + #[DataProvider(methodName: 'retentionObligationProvider')] public function testRetentionObligation(string $obligation, string $quota, int $elapsed, int $fileSize, bool $shouldExpire): void { $this->config->setSystemValues(['trashbin_retention_obligation' => $obligation]); From 966f8a3f4d0c6174d0a6982b43ad719313a4c41c Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Tue, 11 Aug 2026 21:50:12 -0700 Subject: [PATCH 2/2] fix: reword trashbin:expire help and drop the metadata assertion test Per review: "Processes deleted files" was confusing since the command deletes expired files rather than processing them. Description and help now say so directly, and the test that pinned the exact wording is removed. --- .../lib/Command/ExpireTrash.php | 4 ++-- .../tests/Command/ExpireTrashTest.php | 22 ------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index 256be47750613..5d437fdb0a8f6 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -35,8 +35,8 @@ protected function configure(): void { parent::configure(); $this ->setName('trashbin:expire') - ->setDescription('Delete eligible trashbin entries according to the configured retention and space policy') - ->setHelp('Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.') + ->setDescription('Delete expired files from the trashbin') + ->setHelp('Deletes expired files from the trashbin according to the configured retention and space policy. This does not disable the trashbin or unconditionally empty it.') ->addArgument( 'user_id', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, diff --git a/apps/files_trashbin/tests/Command/ExpireTrashTest.php b/apps/files_trashbin/tests/Command/ExpireTrashTest.php index 092da2855eecd..55859da0557b3 100644 --- a/apps/files_trashbin/tests/Command/ExpireTrashTest.php +++ b/apps/files_trashbin/tests/Command/ExpireTrashTest.php @@ -66,28 +66,6 @@ protected function tearDown(): void { parent::tearDown(); } - public function testCommandMetadata(): void { - $command = new ExpireTrash( - Server::get(IUserManager::class), - $this->expiration, - Server::get(SetupManager::class), - Server::get(IRootFolder::class), - ); - - $this->assertSame( - 'Delete eligible trashbin entries according to the configured retention and space policy', - $command->getDescription(), - ); - $this->assertSame( - 'Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.', - $command->getHelp(), - ); - $this->assertSame( - 'Limit processing to the given user ID(s); if no user ID is given, all users are processed', - $command->getDefinition()->getArgument('user_id')->getDescription(), - ); - } - #[DataProvider(methodName: 'retentionObligationProvider')] public function testRetentionObligation(string $obligation, string $quota, int $elapsed, int $fileSize, bool $shouldExpire): void { $this->config->setSystemValues(['trashbin_retention_obligation' => $obligation]);