Removed method isTestingOnOcis, and refactored code

This commit is contained in:
Prarup Gurung
2023-03-13 12:08:42 +05:45
parent fd64718a7c
commit 06169628af
5 changed files with 12 additions and 63 deletions
@@ -2961,15 +2961,7 @@ class FeatureContext extends BehatVariablesContext {
* @throws Exception
*/
public function theFileWithContentShouldExistInTheServerRoot(string $path, string $content): void {
if (OcisHelper::isTestingOnOcis()) {
$fileContent = $this->readFileInServerRootForOCIS($path);
} else {
$this->readFileInServerRootForCore($path);
$this->theHTTPStatusCodeShouldBe(200, 'Failed to read the file $path');
$fileContent = $this->getResponseXml();
$fileContent = (string)$fileContent->data->element->contentUrlEncoded;
$fileContent = \urldecode($fileContent);
}
$fileContent = $this->readFileInServerRootForOCIS($path);
Assert::assertSame(
$content,
$fileContent,