aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php')
-rw-r--r--apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php31
1 files changed, 10 insertions, 21 deletions
diff --git a/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php b/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
index 1173e516a22..a46a1e5e5b0 100644
--- a/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
@@ -16,17 +16,10 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class EventReminderJobTest extends TestCase {
- /** @var ITimeFactory|MockObject */
- private $time;
-
- /** @var ReminderService|MockObject */
- private $reminderService;
-
- /** @var IConfig|MockObject */
- private $config;
-
- /** @var EventReminderJob|MockObject */
- private $backgroundJob;
+ private ITimeFactory&MockObject $time;
+ private ReminderService&MockObject $reminderService;
+ private IConfig&MockObject $config;
+ private EventReminderJob $backgroundJob;
protected function setUp(): void {
parent::setUp();
@@ -42,7 +35,7 @@ class EventReminderJobTest extends TestCase {
);
}
- public function data(): array {
+ public static function data(): array {
return [
[true, true, true],
[true, false, false],
@@ -52,23 +45,19 @@ class EventReminderJobTest extends TestCase {
}
/**
- * @dataProvider data
*
* @param bool $sendEventReminders
* @param bool $sendEventRemindersMode
* @param bool $expectCall
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('data')]
public function testRun(bool $sendEventReminders, bool $sendEventRemindersMode, bool $expectCall): void {
$this->config->expects($this->exactly($sendEventReminders ? 2 : 1))
->method('getAppValue')
- ->withConsecutive(
- ['dav', 'sendEventReminders', 'yes'],
- ['dav', 'sendEventRemindersMode', 'backgroundjob'],
- )
- ->willReturnOnConsecutiveCalls(
- $sendEventReminders ? 'yes' : 'no',
- $sendEventRemindersMode ? 'backgroundjob' : 'cron'
- );
+ ->willReturnMap([
+ ['dav', 'sendEventReminders', 'yes', ($sendEventReminders ? 'yes' : 'no')],
+ ['dav', 'sendEventRemindersMode', 'backgroundjob', ($sendEventRemindersMode ? 'backgroundjob' : 'cron')],
+ ]);
if ($expectCall) {
$this->reminderService->expects($this->once())