Skip to content

Commit 4c04117

Browse files
committed
fix: clarify trashbin expiration CLI help
Fixes #45418
1 parent f8cc0ad commit 4c04117

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

apps/files_trashbin/lib/Command/ExpireTrash.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ protected function configure(): void {
3535
parent::configure();
3636
$this
3737
->setName('trashbin:expire')
38-
->setDescription('Expires the users trashbin')
38+
->setDescription('Delete eligible trashbin entries according to the configured retention and space policy')
39+
->setHelp('Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.')
3940
->addArgument(
4041
'user_id',
4142
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
42-
'expires the trashbin of the given user(s), if no user is given the trash for all users will be expired'
43+
'Limit processing to the given user ID(s); if no user ID is given, all users are processed'
4344
);
4445
}
4546

apps/files_trashbin/tests/Command/ExpireTrashTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ protected function tearDown(): void {
6666
parent::tearDown();
6767
}
6868

69+
public function testCommandMetadata(): void {
70+
$command = new ExpireTrash(
71+
Server::get(IUserManager::class),
72+
$this->expiration,
73+
Server::get(SetupManager::class),
74+
Server::get(IRootFolder::class),
75+
);
76+
77+
$this->assertSame(
78+
'Delete eligible trashbin entries according to the configured retention and space policy',
79+
$command->getDescription(),
80+
);
81+
$this->assertSame(
82+
'Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.',
83+
$command->getHelp(),
84+
);
85+
$this->assertSame(
86+
'Limit processing to the given user ID(s); if no user ID is given, all users are processed',
87+
$command->getDefinition()->getArgument('user_id')->getDescription(),
88+
);
89+
}
90+
6991
#[DataProvider(methodName: 'retentionObligationProvider')]
7092
public function testRetentionObligation(string $obligation, string $quota, int $elapsed, int $fileSize, bool $shouldExpire): void {
7193
$this->config->setSystemValues(['trashbin_retention_obligation' => $obligation]);

0 commit comments

Comments
 (0)