'Invalid regular expression' ] ]]; } public function dataProviderValidValues() { return [ [[], 'foobar'], [[], '/foobar'], [[], 'foobar/'], [[], 'foobar/i'], [[], '/'], [[], ' '], [[], '\\\\'], [[], '[A-Z]+[0-9]{123}foo.*(bar|buz)[^A-K]{4}'], [[], 'asd\('], [[], '^Timestamp \[[0-9]{4}-[A-Za-z]{3}-[0-9]{1,2}\]: ERROR.*$'], [[], '/[a-z]+'], [[], '[a-z]+\ \[/'], [[], '[a-f0-9]{32}/iu'], [[], '[a-f0-9]{32}/i'], [[], '/foo bar// me!/'], [[], 1], [[], 1.2] ]; } public function dataProviderInvalidValues() { return [ [ ['messageInvalid' => 'Not a string'], [], 'Not a string' ], [ ['messageInvalid' => 'Not a string'], null, 'Not a string' ], [ ['messageInvalid' => 'Not a string'], true, 'Not a string' ], [ ['messageRegex' => 'Incorrect regular expression "%1$s": "%2$s"'], '[[', 'Incorrect regular expression "[[": "Compilation failed: missing terminating ] for character class at offset 2"' ], [ ['messageRegex' => 'Incorrect regular expression "%1$s": "%2$s".'], 'asd(', 'Incorrect regular expression "asd(": "Compilation failed: missing closing parenthesis at offset 4".' ] ]; } public function dataProviderInvalidValuesWithObjects() { return [ [ ['messageRegex' => 'Incorrect regular expression "%2$s" for object "%1$s": "%3$s"'], 'test[', 'Incorrect regular expression "test[" for object "object": "Compilation failed: missing terminating ] for character class at offset 5"' ] ]; } protected function createValidator(array $params = []) { return new CRegexValidator($params); } }