Build package / xml-lint (push) Successful in 3m32s
Build package / unit-tests (push) Successful in 4m49s
Build package / php-lint (8.5) (push) Successful in 4m52s
Build package / php-lint (8.4) (push) Successful in 4m56s
Build package / package (push) Successful in 2m28s
Each workflow now has a trigger date (due or start): the runner compares either the card's due date or its start date against now, read straight from Deck's Card entity. Mails and Nextcloud notifications say whether the card was overdue or reached its start date. Cards without the chosen date stay put. Deck only has a start date since 1.18 and Entity getters are magic, so DeckIntegrationService::supportsStartdate() checks the property; without it the form rejects start-date workflows and the runner skips them without disabling them. WorkflowRunner::isOverdue() becomes hasPassed(), as it now covers both dates. Existing workflows keep the due date (migration Version1005). Bumps to 35.4.0 so the migration runs.
32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\WorkflowDeckAutomation\Tests\Unit\Service;
|
|
|
|
use OCA\WorkflowDeckAutomation\Service\TriggerDate;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class TriggerDateTest extends TestCase {
|
|
public function testKnownTriggersAreValid(): void {
|
|
$this->assertTrue(TriggerDate::isValid('due'));
|
|
$this->assertTrue(TriggerDate::isValid('start'));
|
|
}
|
|
|
|
public function testUnknownTriggersAreInvalid(): void {
|
|
$this->assertFalse(TriggerDate::isValid(''));
|
|
$this->assertFalse(TriggerDate::isValid('duedate'));
|
|
$this->assertFalse(TriggerDate::isValid('Start'));
|
|
}
|
|
|
|
public function testReasonNamesTheTriggeringDate(): void {
|
|
$this->assertSame('ist überfällig', TriggerDate::describeReason('due'));
|
|
$this->assertSame('hat ihr Startdatum erreicht', TriggerDate::describeReason('start'));
|
|
}
|
|
|
|
public function testUnknownTriggerIsDescribedAsDue(): void {
|
|
// Notifications stored before the column existed carry no trigger.
|
|
$this->assertSame('ist überfällig', TriggerDate::describeReason(''));
|
|
}
|
|
}
|