DataSift\Storyplayer\Cli\Feature_SystemUnderTestConfigValidator::validate PHP Method

validate() public method

public validate ( mixed $value, Phix_Project\ValidationLib4\ValidationResult $result = null ) : Phix_Project\ValidationLib4\ValidationResult
$value mixed
$result Phix_Project\ValidationLib4\ValidationResult
return Phix_Project\ValidationLib4\ValidationResult
    public function validate($value, ValidationResult $result = null)
    {
        if ($result === null) {
            $result = new ValidationResult($value);
        }
        // strip off .json if it is there
        $value = basename($value, ".json");
        // the $value must be a valid system-under-test name
        if (!$this->sutList->hasEntry($value)) {
            $result->addError(static::MSG_NOTVALIDSUT);
            return $result;
        }
        return $result;
    }
Feature_SystemUnderTestConfigValidator