$commandTester =
new CommandTester($this->deleteExpiredFilesCommand
);
$commandTester->
execute([]);
$message =
$commandTester->
getDisplay();
static::
assertMatchesRegularExpression('/\/\/ No expired files found./',
$message);
} public function testExecuteWithAllFilesExpired(): void
{ $num = 5;
$data =
$this->
prepareImportExportFileTestData($num);
$filePathes =
[];
foreach (array_keys($data) as $key) { $filePathes[] =
$data[$key]['path'
];
$data[$key]['expireDate'
] =
date('Y-m-d H:i:s',
strtotime('-1 second'
));
} $this->fileRepository->
create(array_values($data),
$this->context
);
$commandTester =
new CommandTester($this->deleteExpiredFilesCommand
);
$commandTester->
setInputs(['y'
]);