aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine
diff options
context:
space:
mode:
Diffstat (limited to 'apps/workflowengine')
-rw-r--r--apps/workflowengine/composer/composer/autoload_classmap.php1
-rw-r--r--apps/workflowengine/composer/composer/autoload_static.php1
-rw-r--r--apps/workflowengine/l10n/et_EE.js123
-rw-r--r--apps/workflowengine/l10n/et_EE.json121
-rw-r--r--apps/workflowengine/l10n/lv.js2
-rw-r--r--apps/workflowengine/l10n/lv.json2
-rw-r--r--apps/workflowengine/lib/Check/Directory.php58
-rw-r--r--apps/workflowengine/lib/Manager.php2
-rw-r--r--apps/workflowengine/src/components/Checks/file.js13
-rw-r--r--apps/workflowengine/tests/Check/DirectoryTest.php68
10 files changed, 246 insertions, 145 deletions
diff --git a/apps/workflowengine/composer/composer/autoload_classmap.php b/apps/workflowengine/composer/composer/autoload_classmap.php
index 52d221fb767..0444cce13e7 100644
--- a/apps/workflowengine/composer/composer/autoload_classmap.php
+++ b/apps/workflowengine/composer/composer/autoload_classmap.php
@@ -10,7 +10,6 @@ return array(
'OCA\\WorkflowEngine\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
'OCA\\WorkflowEngine\\BackgroundJobs\\Rotate' => $baseDir . '/../lib/BackgroundJobs/Rotate.php',
'OCA\\WorkflowEngine\\Check\\AbstractStringCheck' => $baseDir . '/../lib/Check/AbstractStringCheck.php',
- 'OCA\\WorkflowEngine\\Check\\Directory' => $baseDir . '/../lib/Check/Directory.php',
'OCA\\WorkflowEngine\\Check\\FileMimeType' => $baseDir . '/../lib/Check/FileMimeType.php',
'OCA\\WorkflowEngine\\Check\\FileName' => $baseDir . '/../lib/Check/FileName.php',
'OCA\\WorkflowEngine\\Check\\FileSize' => $baseDir . '/../lib/Check/FileSize.php',
diff --git a/apps/workflowengine/composer/composer/autoload_static.php b/apps/workflowengine/composer/composer/autoload_static.php
index 57b569dbc10..0b9ac89ae30 100644
--- a/apps/workflowengine/composer/composer/autoload_static.php
+++ b/apps/workflowengine/composer/composer/autoload_static.php
@@ -25,7 +25,6 @@ class ComposerStaticInitWorkflowEngine
'OCA\\WorkflowEngine\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
'OCA\\WorkflowEngine\\BackgroundJobs\\Rotate' => __DIR__ . '/..' . '/../lib/BackgroundJobs/Rotate.php',
'OCA\\WorkflowEngine\\Check\\AbstractStringCheck' => __DIR__ . '/..' . '/../lib/Check/AbstractStringCheck.php',
- 'OCA\\WorkflowEngine\\Check\\Directory' => __DIR__ . '/..' . '/../lib/Check/Directory.php',
'OCA\\WorkflowEngine\\Check\\FileMimeType' => __DIR__ . '/..' . '/../lib/Check/FileMimeType.php',
'OCA\\WorkflowEngine\\Check\\FileName' => __DIR__ . '/..' . '/../lib/Check/FileName.php',
'OCA\\WorkflowEngine\\Check\\FileSize' => __DIR__ . '/..' . '/../lib/Check/FileSize.php',
diff --git a/apps/workflowengine/l10n/et_EE.js b/apps/workflowengine/l10n/et_EE.js
new file mode 100644
index 00000000000..a6dd9bd897e
--- /dev/null
+++ b/apps/workflowengine/l10n/et_EE.js
@@ -0,0 +1,123 @@
+OC.L10N.register(
+ "workflowengine",
+ {
+ "The given operator is invalid" : "Antud operaator/tehtemärk on vigane",
+ "The given regular expression is invalid" : "Antud regulaaravaldis on vigane",
+ "The given file size is invalid" : "Antud faili suurus on vigane",
+ "The given tag id is invalid" : "Antud sildi tunnus on vigane",
+ "The given IP range is invalid" : "Antud IP-aadresside vahemik on vigane",
+ "The given IP range is not valid for IPv4" : "Antud IP vahemik ei kehti IPv4 kohta",
+ "The given IP range is not valid for IPv6" : "Antud IP vahemik ei kehti IPv6 kohta",
+ "The given time span is invalid" : "Antud ajavahemik on vigane",
+ "The given start time is invalid" : "Antud algusaeg on vigane",
+ "The given end time is invalid" : "Antud lõppaeg on vigane",
+ "The given group does not exist" : "Antud gruppi ei leitud",
+ "File" : "Fail",
+ "File created" : "Fail on loodud",
+ "File updated" : "Fail on uuendatud",
+ "File renamed" : "Faili nimi on muudetud",
+ "File deleted" : "Fail on kustutatud",
+ "File accessed" : "Faili on kasutatud",
+ "File copied" : "Fail on kopeeritud",
+ "Tag assigned" : "Silt on lisatud",
+ "Someone" : "Keegi",
+ "%s created %s" : "%s lõi %s",
+ "%s modified %s" : "%s muutis %s",
+ "%s deleted %s" : "%s kustutas %s",
+ "%s accessed %s" : "%s kasutas töövoogu %s",
+ "%s renamed %s" : "%s muutis %s nime",
+ "%s copied %s" : "%s kopeeris %s",
+ "%s assigned %s to %s" : "%s määras %s kasutajale %s",
+ "Operation #%s does not exist" : "Tegevus # %s ei leitud",
+ "Entity %s does not exist" : "%s objekti pole olemas",
+ "Entity %s is invalid" : "%s objekt on vigane",
+ "No events are chosen." : "Ühtegi sündmust pole valitud.",
+ "Entity %s has no event %s" : "%s objektil pole %s sündmust",
+ "Operation %s does not exist" : "%s tegevust pole olemas",
+ "Operation %s is invalid" : " %s tegevus on vigane",
+ "At least one check needs to be provided" : "Pead lisama vähemalt ühe kontrolli",
+ "The provided operation data is too long" : "Lisatud tegevuse andmed on liiga mahukad",
+ "Invalid check provided" : "Oled lisanud vigase kontrolli",
+ "Check %s does not exist" : "%s kontrolli pole olemas",
+ "Check %s is invalid" : "%s kontroll on vigane",
+ "Check %s is not allowed with this entity" : "Selle objekti puhul ei saa kasutada seda kontrolli: %s",
+ "The provided check value is too long" : "Lisatud kontrolli väärtus on liiga pikk",
+ "Check #%s does not exist" : "Kontrolli #%s pole olemas",
+ "Check %s is invalid or does not exist" : "%s kontroll on vigane või pole teda olemas",
+ "Flow" : "Töövoog",
+ "Nextcloud workflow engine" : "Nextcloudi töövoogude mootor",
+ "Select a filter" : "Vali filter",
+ "Select a comparator" : "Vali võrdleja",
+ "Remove filter" : "Eemalda filter",
+ "Folder" : "Kaust",
+ "Images" : "Pildid",
+ "Office documents" : "Kontroritarkvara dokumendid",
+ "PDF documents" : "PDF-dokumendid",
+ "Custom MIME type" : "Sinu määratud MIME-tüüp",
+ "Custom mimetype" : "Sinu määratud MIME-tüüp",
+ "Select a file type" : "Vali failitüüp",
+ "e.g. httpd/unix-directory" : "nt. httpd/unix-directory",
+ "Please enter a valid time span" : "Palun sisesta korrektne ajavahemik",
+ "Files WebDAV" : "WebDAV-i failid",
+ "Custom URL" : "Sinu määratud võrguaadress",
+ "Select a request URL" : "Vali päringu võrguaadress",
+ "Android client" : "Android klient",
+ "iOS client" : "iOS-i klient",
+ "Desktop client" : "Töölaua klient",
+ "Thunderbird & Outlook addons" : "Thunderbirdi ja Outlooki lisad",
+ "Custom user agent" : "Sinu määratud rakenduse tunnus",
+ "Select a user agent" : "Vali rakenduse tunnus",
+ "Select groups" : "Vali grupid",
+ "Groups" : "Grupid",
+ "Type to search for group …" : "Grupi otsimiseks kirjuta midagi…",
+ "Select a trigger" : "Vali päästik",
+ "At least one event must be selected" : "Palun valitud vähemalt üks sündmus",
+ "Add new flow" : "Lisa uus töövoog",
+ "The configuration is invalid" : "Seadistus on vigane",
+ "Active" : "Aktiivne",
+ "Save" : "Salvesta",
+ "When" : "Millal",
+ "and" : "ja",
+ "Add a new filter" : "Lisa uus filter",
+ "Cancel" : "Loobu",
+ "Delete" : "Kustuta",
+ "Available flows" : "Saadaval töövood",
+ "For details on how to write your own flow, check out the development documentation." : "Lisateavet oma töövoogude kirjutamiseks leiad dokumentatsioonist arendajatele.",
+ "No flows installed" : "Ühtegi töövoogu pole paigaldatud",
+ "Ask your administrator to install new flows." : "Palu oma serveri haldajat, et ta paigaldaks uusi töövooge.",
+ "More flows" : "Veel töövooge",
+ "Browse the App Store" : "Sirvi rakendustepoodi",
+ "Show less" : "Näita vähem",
+ "Show more" : "Näita rohkem",
+ "Configured flows" : "Seadistatud töövood",
+ "Your flows" : "Sinu töövood",
+ "No flows configured" : "Ühtegi töövoogu pole seadistatud",
+ "matches" : "kattub",
+ "does not match" : "ei kattu",
+ "is" : "on",
+ "is not" : "ei ole",
+ "File name" : "Failinimi",
+ "File MIME type" : "Faili MIME-tüüp",
+ "File size (upload)" : "Faili suurus (üleslaadimine)",
+ "less" : "väiksem",
+ "less or equals" : "väiksem või võrdne",
+ "greater or equals" : "suurem või võrdne",
+ "greater" : "suurem",
+ "Request remote address" : "Päringu kaugaadress",
+ "matches IPv4" : "kattub IPv4 aadressiga",
+ "does not match IPv4" : "Ei kattu IPv4 aadressiga",
+ "matches IPv6" : "kattub IPv6 aadressiga",
+ "does not match IPv6" : "Ei kattu IPv6 aadressiga",
+ "File system tag" : "Failisüsteemi silt",
+ "is tagged with" : "on sildiga",
+ "is not tagged with" : "ei ole märgitud sildiga",
+ "Request URL" : "Päringu võrguaadress",
+ "Request time" : "Päringu aeg",
+ "between" : "vahemikus",
+ "not between" : "ei ole vahemikus",
+ "Request user agent" : "Päri rakenduse tunnust",
+ "Group membership" : "Grupi liikmelisus",
+ "is member of" : "on liige",
+ "is not member of" : "ei ole liige"
+},
+"nplurals=2; plural=(n != 1);");
diff --git a/apps/workflowengine/l10n/et_EE.json b/apps/workflowengine/l10n/et_EE.json
new file mode 100644
index 00000000000..3da17c5756d
--- /dev/null
+++ b/apps/workflowengine/l10n/et_EE.json
@@ -0,0 +1,121 @@
+{ "translations": {
+ "The given operator is invalid" : "Antud operaator/tehtemärk on vigane",
+ "The given regular expression is invalid" : "Antud regulaaravaldis on vigane",
+ "The given file size is invalid" : "Antud faili suurus on vigane",
+ "The given tag id is invalid" : "Antud sildi tunnus on vigane",
+ "The given IP range is invalid" : "Antud IP-aadresside vahemik on vigane",
+ "The given IP range is not valid for IPv4" : "Antud IP vahemik ei kehti IPv4 kohta",
+ "The given IP range is not valid for IPv6" : "Antud IP vahemik ei kehti IPv6 kohta",
+ "The given time span is invalid" : "Antud ajavahemik on vigane",
+ "The given start time is invalid" : "Antud algusaeg on vigane",
+ "The given end time is invalid" : "Antud lõppaeg on vigane",
+ "The given group does not exist" : "Antud gruppi ei leitud",
+ "File" : "Fail",
+ "File created" : "Fail on loodud",
+ "File updated" : "Fail on uuendatud",
+ "File renamed" : "Faili nimi on muudetud",
+ "File deleted" : "Fail on kustutatud",
+ "File accessed" : "Faili on kasutatud",
+ "File copied" : "Fail on kopeeritud",
+ "Tag assigned" : "Silt on lisatud",
+ "Someone" : "Keegi",
+ "%s created %s" : "%s lõi %s",
+ "%s modified %s" : "%s muutis %s",
+ "%s deleted %s" : "%s kustutas %s",
+ "%s accessed %s" : "%s kasutas töövoogu %s",
+ "%s renamed %s" : "%s muutis %s nime",
+ "%s copied %s" : "%s kopeeris %s",
+ "%s assigned %s to %s" : "%s määras %s kasutajale %s",
+ "Operation #%s does not exist" : "Tegevus # %s ei leitud",
+ "Entity %s does not exist" : "%s objekti pole olemas",
+ "Entity %s is invalid" : "%s objekt on vigane",
+ "No events are chosen." : "Ühtegi sündmust pole valitud.",
+ "Entity %s has no event %s" : "%s objektil pole %s sündmust",
+ "Operation %s does not exist" : "%s tegevust pole olemas",
+ "Operation %s is invalid" : " %s tegevus on vigane",
+ "At least one check needs to be provided" : "Pead lisama vähemalt ühe kontrolli",
+ "The provided operation data is too long" : "Lisatud tegevuse andmed on liiga mahukad",
+ "Invalid check provided" : "Oled lisanud vigase kontrolli",
+ "Check %s does not exist" : "%s kontrolli pole olemas",
+ "Check %s is invalid" : "%s kontroll on vigane",
+ "Check %s is not allowed with this entity" : "Selle objekti puhul ei saa kasutada seda kontrolli: %s",
+ "The provided check value is too long" : "Lisatud kontrolli väärtus on liiga pikk",
+ "Check #%s does not exist" : "Kontrolli #%s pole olemas",
+ "Check %s is invalid or does not exist" : "%s kontroll on vigane või pole teda olemas",
+ "Flow" : "Töövoog",
+ "Nextcloud workflow engine" : "Nextcloudi töövoogude mootor",
+ "Select a filter" : "Vali filter",
+ "Select a comparator" : "Vali võrdleja",
+ "Remove filter" : "Eemalda filter",
+ "Folder" : "Kaust",
+ "Images" : "Pildid",
+ "Office documents" : "Kontroritarkvara dokumendid",
+ "PDF documents" : "PDF-dokumendid",
+ "Custom MIME type" : "Sinu määratud MIME-tüüp",
+ "Custom mimetype" : "Sinu määratud MIME-tüüp",
+ "Select a file type" : "Vali failitüüp",
+ "e.g. httpd/unix-directory" : "nt. httpd/unix-directory",
+ "Please enter a valid time span" : "Palun sisesta korrektne ajavahemik",
+ "Files WebDAV" : "WebDAV-i failid",
+ "Custom URL" : "Sinu määratud võrguaadress",
+ "Select a request URL" : "Vali päringu võrguaadress",
+ "Android client" : "Android klient",
+ "iOS client" : "iOS-i klient",
+ "Desktop client" : "Töölaua klient",
+ "Thunderbird & Outlook addons" : "Thunderbirdi ja Outlooki lisad",
+ "Custom user agent" : "Sinu määratud rakenduse tunnus",
+ "Select a user agent" : "Vali rakenduse tunnus",
+ "Select groups" : "Vali grupid",
+ "Groups" : "Grupid",
+ "Type to search for group …" : "Grupi otsimiseks kirjuta midagi…",
+ "Select a trigger" : "Vali päästik",
+ "At least one event must be selected" : "Palun valitud vähemalt üks sündmus",
+ "Add new flow" : "Lisa uus töövoog",
+ "The configuration is invalid" : "Seadistus on vigane",
+ "Active" : "Aktiivne",
+ "Save" : "Salvesta",
+ "When" : "Millal",
+ "and" : "ja",
+ "Add a new filter" : "Lisa uus filter",
+ "Cancel" : "Loobu",
+ "Delete" : "Kustuta",
+ "Available flows" : "Saadaval töövood",
+ "For details on how to write your own flow, check out the development documentation." : "Lisateavet oma töövoogude kirjutamiseks leiad dokumentatsioonist arendajatele.",
+ "No flows installed" : "Ühtegi töövoogu pole paigaldatud",
+ "Ask your administrator to install new flows." : "Palu oma serveri haldajat, et ta paigaldaks uusi töövooge.",
+ "More flows" : "Veel töövooge",
+ "Browse the App Store" : "Sirvi rakendustepoodi",
+ "Show less" : "Näita vähem",
+ "Show more" : "Näita rohkem",
+ "Configured flows" : "Seadistatud töövood",
+ "Your flows" : "Sinu töövood",
+ "No flows configured" : "Ühtegi töövoogu pole seadistatud",
+ "matches" : "kattub",
+ "does not match" : "ei kattu",
+ "is" : "on",
+ "is not" : "ei ole",
+ "File name" : "Failinimi",
+ "File MIME type" : "Faili MIME-tüüp",
+ "File size (upload)" : "Faili suurus (üleslaadimine)",
+ "less" : "väiksem",
+ "less or equals" : "väiksem või võrdne",
+ "greater or equals" : "suurem või võrdne",
+ "greater" : "suurem",
+ "Request remote address" : "Päringu kaugaadress",
+ "matches IPv4" : "kattub IPv4 aadressiga",
+ "does not match IPv4" : "Ei kattu IPv4 aadressiga",
+ "matches IPv6" : "kattub IPv6 aadressiga",
+ "does not match IPv6" : "Ei kattu IPv6 aadressiga",
+ "File system tag" : "Failisüsteemi silt",
+ "is tagged with" : "on sildiga",
+ "is not tagged with" : "ei ole märgitud sildiga",
+ "Request URL" : "Päringu võrguaadress",
+ "Request time" : "Päringu aeg",
+ "between" : "vahemikus",
+ "not between" : "ei ole vahemikus",
+ "Request user agent" : "Päri rakenduse tunnust",
+ "Group membership" : "Grupi liikmelisus",
+ "is member of" : "on liige",
+ "is not member of" : "ei ole liige"
+},"pluralForm" :"nplurals=2; plural=(n != 1);"
+} \ No newline at end of file
diff --git a/apps/workflowengine/l10n/lv.js b/apps/workflowengine/l10n/lv.js
index 088196c0081..30577193c0a 100644
--- a/apps/workflowengine/l10n/lv.js
+++ b/apps/workflowengine/l10n/lv.js
@@ -26,7 +26,7 @@ OC.L10N.register(
"Nextcloud workflow engine" : "Nextcloud darbplūsmu dzinis",
"Folder" : "Mape",
"Images" : "Attēli",
- "Files WebDAV" : "WebDAV datnes",
+ "Files WebDAV" : "Datņu WebDAV",
"Android client" : "Android klients",
"iOS client" : "iOS klients",
"Desktop client" : "Darbvirsmas klients",
diff --git a/apps/workflowengine/l10n/lv.json b/apps/workflowengine/l10n/lv.json
index 3dce9342e1e..1665558a6fc 100644
--- a/apps/workflowengine/l10n/lv.json
+++ b/apps/workflowengine/l10n/lv.json
@@ -24,7 +24,7 @@
"Nextcloud workflow engine" : "Nextcloud darbplūsmu dzinis",
"Folder" : "Mape",
"Images" : "Attēli",
- "Files WebDAV" : "WebDAV datnes",
+ "Files WebDAV" : "Datņu WebDAV",
"Android client" : "Android klients",
"iOS client" : "iOS klients",
"Desktop client" : "Darbvirsmas klients",
diff --git a/apps/workflowengine/lib/Check/Directory.php b/apps/workflowengine/lib/Check/Directory.php
deleted file mode 100644
index f7b856a95fe..00000000000
--- a/apps/workflowengine/lib/Check/Directory.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-namespace OCA\WorkflowEngine\Check;
-
-use OCA\WorkflowEngine\Entity\File;
-use OCP\IL10N;
-use OCP\WorkflowEngine\IFileCheck;
-
-class Directory extends AbstractStringCheck implements IFileCheck {
- use TFileCheck;
-
- /**
- * @param IL10N $l
- */
- public function __construct(
- IL10N $l,
- ) {
- parent::__construct($l);
- }
-
- /**
- * @return string
- */
- protected function getActualValue(): string {
- if ($this->path === null) {
- return '';
- }
- // files/some/path -> some/path
- return preg_replace('/^files\//', '', pathinfo($this->path, PATHINFO_DIRNAME));
- }
-
- /**
- * @param string $operator
- * @param string $checkValue
- * @param string $actualValue
- * @return bool
- */
- protected function executeStringCheck($operator, $checkValue, $actualValue) {
- if ($operator === 'is' || $operator === '!is') {
- $checkValue = ltrim(rtrim($checkValue, '/'), '/');
- }
- return parent::executeStringCheck($operator, $checkValue, $actualValue);
- }
-
- public function supportedEntities(): array {
- return [ File::class ];
- }
-
- public function isAvailableForScope(int $scope): bool {
- return true;
- }
-}
diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php
index 27b25a2e752..0f41679789d 100644
--- a/apps/workflowengine/lib/Manager.php
+++ b/apps/workflowengine/lib/Manager.php
@@ -8,7 +8,6 @@ namespace OCA\WorkflowEngine;
use Doctrine\DBAL\Exception;
use OCA\WorkflowEngine\AppInfo\Application;
-use OCA\WorkflowEngine\Check\Directory;
use OCA\WorkflowEngine\Check\FileMimeType;
use OCA\WorkflowEngine\Check\FileName;
use OCA\WorkflowEngine\Check\FileSize;
@@ -693,7 +692,6 @@ class Manager implements IManager {
protected function getBuildInChecks(): array {
try {
return [
- $this->container->query(Directory::class),
$this->container->query(FileMimeType::class),
$this->container->query(FileName::class),
$this->container->query(FileSize::class),
diff --git a/apps/workflowengine/src/components/Checks/file.js b/apps/workflowengine/src/components/Checks/file.js
index b2d348e4712..568efc81cd3 100644
--- a/apps/workflowengine/src/components/Checks/file.js
+++ b/apps/workflowengine/src/components/Checks/file.js
@@ -32,19 +32,6 @@ const FileChecks = [
},
{
- class: 'OCA\\WorkflowEngine\\Check\\Directory',
- name: t('workflowengine', 'Directory'),
- operators: stringOrRegexOperators,
- placeholder: (check) => {
- if (check.operator === 'matches' || check.operator === '!matches') {
- return '/^myfolder/.+$/i'
- }
- return 'myfolder/subfolder'
- },
- validate: stringValidator,
- },
-
- {
class: 'OCA\\WorkflowEngine\\Check\\FileMimeType',
name: t('workflowengine', 'File MIME type'),
operators: stringOrRegexOperators,
diff --git a/apps/workflowengine/tests/Check/DirectoryTest.php b/apps/workflowengine/tests/Check/DirectoryTest.php
deleted file mode 100644
index 6eef082b5e5..00000000000
--- a/apps/workflowengine/tests/Check/DirectoryTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-declare(strict_types=1);
-/**
- * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-
-namespace OCA\WorkflowEngine\Tests\Check;
-
-use OCA\WorkflowEngine\Check\Directory;
-use OCA\WorkflowEngine\Entity\File;
-use OCP\Files\Storage\IStorage;
-use OCP\IL10N;
-use Test\TestCase;
-
-class DirectoryTest extends TestCase {
- /** @var IL10N */
- private $l10n;
-
- /** @var IStorage */
- private $storage;
-
- /** @var Directory */
- private $directory;
-
- protected function setUp(): void {
- parent::setUp();
- $this->l10n = $this->createMock(IL10N::class);
- $this->storage = $this->createMock(IStorage::class);
- $this->directory = new Directory($this->l10n);
- }
-
- /**
- * @dataProvider dataProviderCheck
- */
- public function testExecuteStringCheck(string $operator, string $configuredDirectoryPath, string $filePath, bool $expectedResult): void {
- $this->directory->setFileInfo($this->storage, $filePath);
-
- $result = $this->directory->executeCheck($operator, $configuredDirectoryPath);
-
- $this->assertEquals($expectedResult, $result);
- }
-
- public function testSupportedEntities(): void {
- $this->assertSame([File::class], $this->directory->supportedEntities());
- }
-
- public function testIsAvailableForScope(): void {
- $this->assertTrue($this->directory->isAvailableForScope(1));
- }
-
- public function dataProviderCheck(): array {
- return [
- ['is', 'some/path', 'files/some/path/file.txt', true],
- ['is', '/some/path/', 'files/some/path/file.txt', true],
-
- ['!is', 'some/path', 'files/some/path/file.txt', false],
- ['!is', 'some/path/', 'files/someother/path/file.txt', true],
-
- ['matches', '/^some\/path\/.+$/i', 'files/SomE/PATH/subfolder/file.txt', true],
- ['matches', '/some\/path\/.*\/sub2/', 'files/some/path/subfolder1/sub2/anotherfile.pdf', true],
-
- ['!matches', '/some\/path/', 'files/some/path/file.txt', false],
- ['!matches', '/some\/path/', 'files/another/path/file.txt', true],
- ];
- }
-}