moduleDirectory = $moduleDirectory; $this->fileIo = $fileIo; } /** * Loads mock cgi response body for a given country * * @param string $country * @return string * @throws NotFoundException */ public function loadForRequest(string $country): string { $country = strtolower($country); $moduleDir = $this->moduleDirectory->getDir('Magento_TestModuleUps'); $responsePath = sprintf(static::RESPONSE_FILE_PATTERN, $moduleDir, $country); if (!$this->fileIo->fileExists($responsePath)) { throw new NotFoundException(__('%1 is not a valid destination country.', $country)); } return $this->fileIo->read($responsePath); } }