From fcfb1fae14b3b7d73a206f8a3d728648678a49b9 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Mon, 25 Mar 2019 16:06:00 +0545 Subject: [PATCH] substitute ocs path in feature files --- .../features/bootstrap/BasicStructure.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/acceptance/features/bootstrap/BasicStructure.php b/tests/acceptance/features/bootstrap/BasicStructure.php index b969e147a65e..f6d2c52f266d 100644 --- a/tests/acceptance/features/bootstrap/BasicStructure.php +++ b/tests/acceptance/features/bootstrap/BasicStructure.php @@ -492,6 +492,18 @@ public function getBasePath() { return \ltrim(\parse_url($this->getBaseUrl(), PHP_URL_PATH), "/"); } + /** + * returns the OCS path + * the path is without a slash at the end and without a slash at the beginning + * + * @param string $ocsApiVersion + * + * @return string + */ + public function getOCSPath($ocsApiVersion) { + return \ltrim($this->getBasePath() . "/ocs/v{$ocsApiVersion}.php", "/"); + } + /** * returns the base URL but without "http(s)://" in front of it * @@ -1897,6 +1909,22 @@ public function substituteInLineCodes( ], "parameter" => [] ], + [ + "code" => "%ocs_path_v1%", + "function" => [ + $this, + "getOCSPath" + ], + "parameter" => [1] + ], + [ + "code" => "%ocs_path_v2%", + "function" => [ + $this, + "getOCSPath" + ], + "parameter" => [2] + ], [ "code" => "%productname%", "function" => [