/** * @dataProvider supportedRegexes */ public function testGeneratesOnlyValuesThatMatchTheRegex($expression) { $generator = new Regex($expression); for ($i = 0; $i < 100; $i++) { $value = $generator($this->size); $this->assertTrue($generator->contains($value), "Failed asserting that " . var_export($value, true) . " matches the regexp {$expression}"); } }