mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
Removed method isTestingOnOc10, and refactored code
This commit is contained in:
@@ -47,13 +47,6 @@ class OcisHelper {
|
||||
return (\getenv("TEST_REVA") === "true");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isTestingOnOc10():bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
@@ -2783,60 +2783,34 @@ class FeatureContext extends BehatVariablesContext {
|
||||
$jsonExpectedDecoded['product'] = $product;
|
||||
$jsonExpectedDecoded['productname'] = $productName;
|
||||
|
||||
if (OcisHelper::isTestingOnOc10()) {
|
||||
// On oC10 get the expected version values by parsing the output of "occ status"
|
||||
$runOccStatus = $this->runOcc(['status']);
|
||||
if ($runOccStatus === 0) {
|
||||
$output = \explode("- ", $this->lastStdOut);
|
||||
$version = \explode(": ", $output[3]);
|
||||
Assert::assertEquals(
|
||||
"version",
|
||||
$version[0],
|
||||
"Expected 'version' but got $version[0]"
|
||||
);
|
||||
$versionString = \explode(": ", $output[4]);
|
||||
Assert::assertEquals(
|
||||
"versionstring",
|
||||
$versionString[0],
|
||||
"Expected 'versionstring' but got $versionString[0]"
|
||||
);
|
||||
$jsonExpectedDecoded['version'] = \trim($version[1]);
|
||||
$jsonExpectedDecoded['versionstring'] = \trim($versionString[1]);
|
||||
} else {
|
||||
Assert::fail(
|
||||
"Cannot get version variables from occ - status $runOccStatus"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// We are on oCIS or reva or some other implementation. We cannot do "occ status".
|
||||
// So get the expected version values by looking in the capabilities response.
|
||||
$version = $this->appConfigurationContext->getParameterValueFromXml(
|
||||
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
|
||||
'core',
|
||||
'status@@@version'
|
||||
// We are on oCIS or reva or some other implementation. We cannot do "occ status".
|
||||
// So get the expected version values by looking in the capabilities response.
|
||||
$version = $this->appConfigurationContext->getParameterValueFromXml(
|
||||
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
|
||||
'core',
|
||||
'status@@@version'
|
||||
);
|
||||
|
||||
if (!\strlen($version)) {
|
||||
Assert::fail(
|
||||
"Cannot get version from core capabilities"
|
||||
);
|
||||
|
||||
if (!\strlen($version)) {
|
||||
Assert::fail(
|
||||
"Cannot get version from core capabilities"
|
||||
);
|
||||
}
|
||||
|
||||
$versionString = $this->appConfigurationContext->getParameterValueFromXml(
|
||||
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
|
||||
'core',
|
||||
'status@@@versionstring'
|
||||
);
|
||||
|
||||
if (!\strlen($versionString)) {
|
||||
Assert::fail(
|
||||
"Cannot get versionstring from core capabilities"
|
||||
);
|
||||
}
|
||||
|
||||
$jsonExpectedDecoded['version'] = $version;
|
||||
$jsonExpectedDecoded['versionstring'] = $versionString;
|
||||
}
|
||||
|
||||
$versionString = $this->appConfigurationContext->getParameterValueFromXml(
|
||||
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
|
||||
'core',
|
||||
'status@@@versionstring'
|
||||
);
|
||||
|
||||
if (!\strlen($versionString)) {
|
||||
Assert::fail(
|
||||
"Cannot get versionstring from core capabilities"
|
||||
);
|
||||
}
|
||||
|
||||
$jsonExpectedDecoded['version'] = $version;
|
||||
$jsonExpectedDecoded['versionstring'] = $versionString;
|
||||
$errorMessage = "";
|
||||
$errorFound = false;
|
||||
foreach ($jsonExpectedDecoded as $key => $expectedValue) {
|
||||
|
||||
Reference in New Issue
Block a user