Skip to content

Commit b985b07

Browse files
committed
style(workflowengine): apply rector and cs-fixer to RuleMatcher tests
Keeps the new tests in line with the strict rector and php-cs-fixer CI checks. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 6c7bb16 commit b985b07

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

‎apps/workflowengine/tests/Service/FileCheckStub.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
77
* SPDX-License-Identifier: AGPL-3.0-or-later
88
*/
9+
910
namespace OCA\WorkflowEngine\Tests\Service;
1011

1112
use OCP\Files\Storage\IStorage;

‎apps/workflowengine/tests/Service/RuleMatcherTest.php‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,19 @@
2929

3030
class RuleMatcherTest extends TestCase {
3131
private IUserSession&MockObject $session;
32+
3233
private ContainerInterface&MockObject $container;
34+
3335
private IL10N&MockObject $l;
36+
3437
private Manager&MockObject $manager;
38+
3539
private Logger&MockObject $logger;
40+
3641
private RuleMatcher $ruleMatcher;
42+
3743
private IOperation&MockObject $operation;
44+
3845
private IEntity&MockObject $entity;
3946

4047
protected function setUp(): void {
@@ -104,26 +111,33 @@ public function testGetFlowsThrowsIfOperationNotSet(): void {
104111
$this->ruleMatcher->getFlows();
105112
}
106113

114+
/**
115+
* @param string[] $events
116+
* @return array<string, bool|int|string>
117+
*/
107118
private function buildDbOperation(string $name = 'DbOp', array $events = ['MyEvent']): array {
108119
return [
109120
'id' => 1,
110-
'class' => get_class($this->operation),
121+
'class' => $this->operation::class,
111122
'name' => $name,
112123
'checks' => '[]',
113124
'operation' => '',
114-
'entity' => get_class($this->entity),
125+
'entity' => $this->entity::class,
115126
'events' => json_encode($events),
116127
];
117128
}
118129

130+
/**
131+
* @param string[] $events
132+
*/
119133
private function buildRuntimeOperation(string $name = 'RuntimeOp', array $events = ['MyEvent']): RuntimeOperation {
120134
return new RuntimeOperation(
121135
id: 'runtime-op-1',
122-
class: get_class($this->operation),
136+
class: $this->operation::class,
123137
name: $name,
124138
checks: [],
125139
operation: '',
126-
entity: get_class($this->entity),
140+
entity: $this->entity::class,
127141
events: $events,
128142
appId: 'testapp',
129143
);

0 commit comments

Comments
 (0)