/** * @param \Box\TestScribe\Config\Options $options * @param \Box\TestScribe\Config\ConfigParams $inputParams * * @return \Box\TestScribe\Config\ConfigParams */ public function getOutputParams(Options $options, ConfigParams $inputParams) { $inFullClassName = $inputParams->getFullClassName(); $outFullClassName = $inFullClassName . 'GenTest'; $outPhpClassName = new PhpClassName($outFullClassName); $outSimpleClassName = $outPhpClassName->getClassName(); $outSourceFileDir = $options->getOutSourceFileDir(); $outSourceFilePath = $outSourceFileDir . DIRECTORY_SEPARATOR . $outSimpleClassName . '.php'; $overwriteExistingDestinationFile = $options->isOverwriteExistingDestinationFile(); $methodName = $inputParams->getMethodName(); $specPerClass = $this->savedSpecs->loadExistingSpecs($inputParams, $outSourceFileDir); $outTestMethodName = $this->outputTestNameGetter->getTestName($methodName, $overwriteExistingDestinationFile, $specPerClass); $outputParams = new ConfigParams($outSourceFilePath, $outPhpClassName, $outTestMethodName); return $outputParams; }
/** * @param \Box\TestScribe\Config\ConfigParams $inputParams * @param \Box\TestScribe\MethodInfo\Method $inMethod * @param \Box\TestScribe\Config\Options $options * @param \Box\TestScribe\Config\ConfigParams $outputParams */ function __construct(ConfigParams $inputParams, Method $inMethod, Options $options, ConfigParams $outputParams) { $this->inPhpClassName = $inputParams->getPhpClassName(); $this->inMethod = $inMethod; $this->inSourceFile = $inputParams->getSourceFile(); $this->outPhpClassName = $outputParams->getPhpClassName(); $this->outSourceFile = $outputParams->getSourceFile(); $this->outMethodName = $outputParams->getMethodName(); $this->overwriteExistingDestinationFile = $options->isOverwriteExistingDestinationFile(); $this->testFileRoot = $options->getTestRootPath(); $this->sourceFilePathRelativeToSourceRoot = $options->getSourceFilePathRelativeToSourceRoot(); $this->generateSpec = $options->isGenerateSpec(); $this->outSourcePath = $options->getOutSourceFileDir(); $this->specFilePath = StaticConfigHelper::computeSpecFilePath($this->inPhpClassName, $this->outSourcePath); $this->options = $options; }