/** * @covers StdLib\Validator\OptionsExtractor::getAllSanitize * @dataProvider sanitizeProvider */ public function testAllSanitized($key, $value) { $this->applyValidationConfig(); $optionExtractor = new OptionsExtractor($this->config, $this->router); $result = $optionExtractor->getAllSanitize(); $this->assertEquals($result[0][$key], $value); $this->assertCount(3, $result[0]); }
/** * Checks an returns the validation object * or null otherwise * @param ServerRequestInterface $request * @return ValidationRulesInterface */ private function getValidatorObject(ServerRequestInterface $request) { $routeConfig = $this->optionsExtractor->getOptionsForRequest($request); if (isset($routeConfig['validation'])) { return $this->getValidationObjectForRequest($request, $routeConfig['validation']); } else { // No associated validation return null; } }