Skip to content

Commit

Permalink
run setup only
Browse files Browse the repository at this point in the history
Signed-off-by: nabim777 <[email protected]>
  • Loading branch information
nabim777 committed Oct 2, 2024
1 parent 9654f47 commit da4e2e0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
9 changes: 4 additions & 5 deletions lib/VersionUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
namespace OCA\OpenProject;

use OC_Util;
use OCP\ServerVersion;

class VersionUtil {

/**
* @var ServerVersion|null
* @var object|null
*/
private ?ServerVersion $serverVersion = null;
private mixed $serverVersion = null;

public function __construct(ServerVersion $serverVersion) {
public function __construct() {
if (class_exists(ServerVersion::class)) {
$this->serverVersion = $serverVersion;
$this->serverVersion = new \OCP\ServerVersion();
}
}

Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jsunit:

.PHONY: api-test
api-test:
vendor/bin/behat -c tests/acceptance/config/behat.yml --tags '${FILTER_TAGS}' ${FEATURE_PATH}
vendor/bin/behat -c tests/acceptance/config/behat.yml --tags '${FILTER_TAGS}' tests/acceptance/features/api/setup.feature

.PHONY: test
test: phpunit jsunit api-test
Expand Down
39 changes: 19 additions & 20 deletions tests/acceptance/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ public function verifyTableNodeRows(TableNode $table, array $requiredRows = [],
* @param BeforeScenarioScope $scope
*
* @return void
* @throws Exception
*/
public function before(BeforeScenarioScope $scope):void {
setlocale(LC_ALL, 'C.utf8');
Expand All @@ -1174,35 +1175,17 @@ public function before(BeforeScenarioScope $scope):void {
$this->sharingContext = $environment->getContext('SharingContext');
$this->directUploadContext = $environment->getContext('DirectUploadContext');
}
}

/**
* @AfterScenario
*
* @return void
* @throws Exception
*/
public function after():void {
foreach ($this->createdUsers as $userData) {
$this->theAdministratorDeletesTheUser($userData['userid']);
}
foreach ($this->createdgroups as $groups) {
$this->theAdministratorDeletesTheGroup($groups);
}
$this->createdAppPasswords = [];
$this->setGroupfolderDavPath();
}

/**
* This will run before EVERY scenario.
* It will set the group folder dev path
*
* @BeforeScenario
*
* @param BeforeScenarioScope $scope
* @return void
* @throws Exception
*/
final public function setgroupfolderDavPath(BeforeScenarioScope $scope): void {
private function setGroupfolderDavPath(): void {
// groupfolder with version greater then 19.0.0 uses "ocs/v2.php/" endpoint
$capabilitiesResponse = $this->sendOCSRequest(
'/cloud/capabilities', 'GET', $this->getAdminUsername()
Expand All @@ -1216,4 +1199,20 @@ final public function setgroupfolderDavPath(BeforeScenarioScope $scope): void {
$this->groupFolderDavPath = "ocs/v2.php/";
}
}

/**
* @AfterScenario
*
* @return void
* @throws Exception
*/
public function after():void {
foreach ($this->createdUsers as $userData) {
$this->theAdministratorDeletesTheUser($userData['userid']);
}
foreach ($this->createdgroups as $groups) {
$this->theAdministratorDeletesTheGroup($groups);
}
$this->createdAppPasswords = [];
}
}

0 comments on commit da4e2e0

Please sign in to comment.