Removed method runOcc from FeatureContext, and refactored code

This commit is contained in:
Prarup Gurung
2023-03-15 17:16:54 +05:45
parent 6f7bd454b2
commit aac714be9a
7 changed files with 2 additions and 368 deletions
@@ -1116,46 +1116,4 @@ class TrashbinContext implements Context {
"$resource expected to be listed in response with mtime '$expectedMtime' but found '$responseMtime'"
);
}
/**
* @Given the administrator has set the following file extensions to be skipped from the trashbin
*
* @param TableNode $table
*
* @return void
* @throws Exception
*/
public function theAdministratorHasSetFollowingFileExtensionsToBeSkippedFromTrashbin(TableNode $table):void {
$this->featureContext->verifyTableNodeColumns($table, ['extension']);
foreach ($table->getHash() as $idx => $row) {
$this->featureContext->runOcc(['config:system:set', 'trashbin_skip_extensions', $idx, '--value=' . $row['extension']]);
}
}
/**
* @Given the administrator has set the following directories to be skipped from the trashbin
*
* @param TableNode $table
*
* @return void
* @throws Exception
*/
public function theAdministratorHasSetFollowingDirectoriesToBeSkippedFromTrashbin(TableNode $table):void {
$this->featureContext->verifyTableNodeColumns($table, ['directory']);
foreach ($table->getHash() as $idx => $row) {
$this->featureContext->runOcc(['config:system:set', 'trashbin_skip_directories', $idx, '--value=' . $row['directory']]);
}
}
/**
* @Given the administrator has set the trashbin skip size threshold to :threshold
*
* @param string $threshold
*
* @return void
* @throws Exception
*/
public function theAdministratorHasSetTrashbinSkipSizethreshold(string $threshold) {
$this->featureContext->runOcc(['config:system:set', 'trashbin_skip_size_threshold', '--value=' . $threshold]);
}
}