Skip to content

Commit

Permalink
Merge pull request #34888 from owncloud/substitudeOCSPath
Browse files Browse the repository at this point in the history
substitute ocs path in feature files
  • Loading branch information
individual-it authored Mar 25, 2019
2 parents 67c3a1f + fcfb1fa commit 67c4ba1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/acceptance/features/bootstrap/BasicStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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" => [
Expand Down

0 comments on commit 67c4ba1

Please sign in to comment.