Add Deck workflow automation Nextcloud app
Lint info.xml / xml-lint (push) Successful in 30s
Lint PHP / php-lint (8.2) (push) Successful in 55s
Lint PHP / php-lint (8.3) (push) Successful in 44s
Lint PHP / php-lint (8.4) (push) Successful in 41s
PHPUnit / unit-tests (push) Failing after 41s

Ports the standalone due-date cron script into a proper Nextcloud 34
app with a personal-settings UI, per-user workflow configuration
(source/target stack, assigned-user and label filters, email
notification), a TimedJob background runner, and Gitea CI pipelines.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Patrick Niebeling
2026-08-13 10:13:05 +02:00
co-authored by Claude Sonnet 5
commit 300acde27e
34 changed files with 1918 additions and 0 deletions
@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace OCA\WorkflowDeckAutomation\Tests\Unit\Service;
use OCA\WorkflowDeckAutomation\Service\WorkflowRunner;
use PHPUnit\Framework\TestCase;
class WorkflowRunnerFilterTest extends TestCase {
public function testIsOverdueReturnsFalseWithoutDueDate(): void {
$this->assertFalse(WorkflowRunner::isOverdue(null));
}
public function testIsOverdueReturnsFalseForFutureDueDate(): void {
$this->assertFalse(WorkflowRunner::isOverdue(0));
$this->assertFalse(WorkflowRunner::isOverdue(3));
}
public function testIsOverdueReturnsTrueForPastDueDate(): void {
$this->assertTrue(WorkflowRunner::isOverdue(-1));
$this->assertTrue(WorkflowRunner::isOverdue(-30));
}
public function testNoFiltersMatchesAnyCard(): void {
$this->assertTrue(WorkflowRunner::cardMatchesFilters(['alice'], [1, 2], [], []));
$this->assertTrue(WorkflowRunner::cardMatchesFilters([], [], [], []));
}
public function testUserFilterIsOrAgainstAssignedUsers(): void {
$this->assertTrue(WorkflowRunner::cardMatchesFilters(['alice', 'bob'], [], ['bob', 'carol'], []));
$this->assertFalse(WorkflowRunner::cardMatchesFilters(['alice'], [], ['bob', 'carol'], []));
}
public function testLabelFilterIsOrAgainstCardLabels(): void {
$this->assertTrue(WorkflowRunner::cardMatchesFilters([], [1, 2], [], [2, 3]));
$this->assertFalse(WorkflowRunner::cardMatchesFilters([], [1], [], [2, 3]));
}
public function testUserAndLabelFiltersAreCombinedWithAnd(): void {
// user matches, label does not -> overall false
$this->assertFalse(WorkflowRunner::cardMatchesFilters(['alice'], [1], ['alice'], [99]));
// both match -> true
$this->assertTrue(WorkflowRunner::cardMatchesFilters(['alice'], [1], ['alice'], [1]));
}
}
+5
View File
@@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../vendor/autoload.php';