diff --git a/tests/TestHelpers/OcisHelper.php b/tests/TestHelpers/OcisHelper.php index 38f13ab5ae..148c130492 100644 --- a/tests/TestHelpers/OcisHelper.php +++ b/tests/TestHelpers/OcisHelper.php @@ -47,13 +47,6 @@ class OcisHelper { return (\getenv("TEST_REVA") === "true"); } - /** - * @return bool - */ - public static function isTestingOnOc10():bool { - return false; - } - /** * @return bool */ diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php index 11d27f1f52..be4a8fea01 100644 --- a/tests/acceptance/features/bootstrap/FeatureContext.php +++ b/tests/acceptance/features/bootstrap/FeatureContext.php @@ -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) {