@@ -192,11 +192,11 @@ function(\PHPUnit_Framework_MockObject_MockObject $validator, \PHPUnit_Framework
192192
193193 $ validator ->expects ($ self ->at (0 ))
194194 ->method ('validateValue ' )
195- ->with ('bar ' , new Regex (array ('pattern ' => '#^ \\\d\ +$#xsu ' , 'message ' => "Query parameter value 'bar', does not match requirements ' \\d+' " )), null )
195+ ->with ('bar ' , new Regex (array ('pattern ' => '#^ \\d +$#xsu ' , 'message ' => "Query parameter value 'bar', does not match requirements ' \\d+' " )), null )
196196 ->will ($ self ->returnValue ($ errors ));
197197 $ validator ->expects ($ self ->at (1 ))
198198 ->method ('validateValue ' )
199- ->with ('bar ' , new Regex (array ('pattern ' => '#^ \\\d\ +$#xsu ' , 'message ' => "Query parameter value 'bar', does not match requirements ' \\d+' " )), null )
199+ ->with ('bar ' , new Regex (array ('pattern ' => '#^ \\d +$#xsu ' , 'message ' => "Query parameter value 'bar', does not match requirements ' \\d+' " )), null )
200200 ->will ($ self ->returnValue ($ errors ));
201201
202202 }
@@ -236,12 +236,12 @@ function(\PHPUnit_Framework_MockObject_MockObject $validator, \PHPUnit_Framework
236236
237237 $ validator ->expects ($ self ->at (1 ))
238238 ->method ('validateValue ' )
239- ->with ('invaliddata ' , new Regex (array ('pattern ' => '#^ \\\d\ +$#xsu ' , 'message ' => "Query parameter value 'invaliddata', does not match requirements ' \\d+' " )), null )
239+ ->with ('invaliddata ' , new Regex (array ('pattern ' => '#^ \\d +$#xsu ' , 'message ' => "Query parameter value 'invaliddata', does not match requirements ' \\d+' " )), null )
240240 ->will ($ self ->returnValue ($ errors ));
241241
242242 $ validator ->expects ($ self ->at (6 ))
243243 ->method ('validateValue ' )
244- ->with ('invaliddata ' , new Regex (array ('pattern ' => '#^ \\\d\ +$#xsu ' , 'message ' => "Query parameter value 'invaliddata', does not match requirements ' \\d+' " )), null )
244+ ->with ('invaliddata ' , new Regex (array ('pattern ' => '#^ \\d +$#xsu ' , 'message ' => "Query parameter value 'invaliddata', does not match requirements ' \\d+' " )), null )
245245 ->will ($ self ->returnValue ($ errors ));
246246 }
247247 ),
@@ -285,6 +285,16 @@ function(\PHPUnit_Framework_MockObject_MockObject $validator, \PHPUnit_Framework
285285
286286 public function testValidatesConfiguredParamStrictly ()
287287 {
288+ $ constraint = new Regex (array (
289+ 'pattern ' => '#^\d+$#xsu ' ,
290+ 'message ' => "Query parameter value '354', does not match requirements ' \\d+' "
291+ ));
292+
293+ $ this ->validator ->expects ($ this ->once ())
294+ ->method ('validateValue ' )
295+ ->with ('354 ' , $ constraint )
296+ ;
297+
288298 $ queryFetcher = $ this ->getParamFetcher (array ('boozz ' => 354 ), array ());
289299 $ queryFetcher ->setController ($ this ->controller );
290300 $ this ->assertEquals (354 , $ queryFetcher ->get ('boozz ' , true ));
@@ -355,12 +365,12 @@ function(\PHPUnit_Framework_MockObject_MockObject $validator, \PHPUnit_Framework
355365
356366 $ validator ->expects ($ self ->at (0 ))
357367 ->method ('validateValue ' )
358- ->with ('foo ' , new Regex (array ('pattern ' => '#^ \\\d\ +$#xsu ' , 'message ' => "Request parameter value 'foo', does not match requirements ' \\d+' " )), null )
368+ ->with ('foo ' , new Regex (array ('pattern ' => '#^ \\d +$#xsu ' , 'message ' => "Request parameter value 'foo', does not match requirements ' \\d+' " )), null )
359369 ->will ($ self ->returnValue ($ errors ));
360370
361371 $ validator ->expects ($ self ->at (1 ))
362372 ->method ('validateValue ' )
363- ->with ('foo ' , new Regex (array ('pattern ' => '#^ \\\d\ +$#xsu ' , 'message ' => "Request parameter value 'foo', does not match requirements ' \\d+' " )), null )
373+ ->with ('foo ' , new Regex (array ('pattern ' => '#^ \\d +$#xsu ' , 'message ' => "Request parameter value 'foo', does not match requirements ' \\d+' " )), null )
364374 ->will ($ self ->returnValue ($ errors ));
365375 }
366376 ),
@@ -375,7 +385,7 @@ function(\PHPUnit_Framework_MockObject_MockObject $validator, \PHPUnit_Framework
375385
376386 $ validator ->expects ($ self ->at (0 ))
377387 ->method ('validateValue ' )
378- ->with ('foo ' , new Regex (array ('pattern ' => '#^ \\\d\ ?$#xsu ' , 'message ' => "Request parameter value 'foo', does not match requirements ' \\d?' " )), null )
388+ ->with ('foo ' , new Regex (array ('pattern ' => '#^ \\d ?$#xsu ' , 'message ' => "Request parameter value 'foo', does not match requirements ' \\d?' " )), null )
379389 ->will ($ self ->returnValue ($ errors ));
380390 }
381391 ),
0 commit comments