File tree Expand file tree Collapse file tree 14 files changed +77
-14
lines changed
src/Symfony/Component/Validator Expand file tree Collapse file tree 14 files changed +77
-14
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ public function __construct($options = null)
101
101
}
102
102
103
103
if (null !== $ this ->normalizer && !\is_callable ($ options ['normalizer ' ])) {
104
- throw new \InvalidArgumentException ('The "normalizer" parameter value is not a valid callable. ' );
104
+ throw new \InvalidArgumentException (sprintf ( 'The "normalizer" option must be a valid callable ("%s" given). ' , is_object ( $ this -> normalizer ) ? get_class ( $ this -> normalizer ) : gettype ( $ this -> normalizer )) );
105
105
}
106
106
}
107
107
}
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public function __construct($options = null)
86
86
}
87
87
88
88
if (null !== $ this ->normalizer && !\is_callable ($ options ['normalizer ' ])) {
89
- throw new \InvalidArgumentException ('The "normalizer" parameter value is not a valid callable. ' );
89
+ throw new \InvalidArgumentException (sprintf ( 'The "normalizer" option must be a valid callable ("%s" given). ' , is_object ( $ this -> normalizer ) ? get_class ( $ this -> normalizer ) : gettype ( $ this -> normalizer )) );
90
90
}
91
91
}
92
92
}
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function __construct($options = null)
57
57
}
58
58
59
59
if (null !== $ this ->normalizer && !\is_callable ($ options ['normalizer ' ])) {
60
- throw new \InvalidArgumentException ('The "normalizer" parameter value is not a valid callable. ' );
60
+ throw new \InvalidArgumentException (sprintf ( 'The "normalizer" option must be a valid callable ("%s" given). ' , is_object ( $ this -> normalizer ) ? get_class ( $ this -> normalizer ) : gettype ( $ this -> normalizer )) );
61
61
}
62
62
}
63
63
}
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public function __construct($options = null)
37
37
parent ::__construct ($ options );
38
38
39
39
if (null !== $ this ->normalizer && !\is_callable ($ options ['normalizer ' ])) {
40
- throw new \InvalidArgumentException ('The "normalizer" parameter value is not a valid callable. ' );
40
+ throw new \InvalidArgumentException (sprintf ( 'The "normalizer" option must be a valid callable ("%s" given). ' , is_object ( $ this -> normalizer ) ? get_class ( $ this -> normalizer ) : gettype ( $ this -> normalizer )) );
41
41
}
42
42
}
43
43
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public function __construct($options = null)
38
38
parent ::__construct ($ options );
39
39
40
40
if (null !== $ this ->normalizer && !\is_callable ($ options ['normalizer ' ])) {
41
- throw new \InvalidArgumentException ('The "normalizer" parameter value is not a valid callable. ' );
41
+ throw new \InvalidArgumentException (sprintf ( 'The "normalizer" option must be a valid callable ("%s" given). ' , is_object ( $ this -> normalizer ) ? get_class ( $ this -> normalizer ) : gettype ( $ this -> normalizer )) );
42
42
}
43
43
}
44
44
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ public function __construct($options = null)
121
121
parent ::__construct ($ options );
122
122
123
123
if (null !== $ this ->normalizer && !\is_callable ($ options ['normalizer ' ])) {
124
- throw new \InvalidArgumentException ('The "normalizer" parameter value is not a valid callable. ' );
124
+ throw new \InvalidArgumentException (sprintf ( 'The "normalizer" option must be a valid callable ("%s" given). ' , is_object ( $ this -> normalizer ) ? get_class ( $ this -> normalizer ) : gettype ( $ this -> normalizer )) );
125
125
}
126
126
}
127
127
}
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public function __construct($options = null)
82
82
parent ::__construct ($ options );
83
83
84
84
if (null !== $ this ->normalizer && !\is_callable ($ options ['normalizer ' ])) {
85
- throw new \InvalidArgumentException ('The "normalizer" parameter value is not a valid callable. ' );
85
+ throw new \InvalidArgumentException (sprintf ( 'The "normalizer" option must be a valid callable ("%s" given). ' , is_object ( $ this -> normalizer ) ? get_class ( $ this -> normalizer ) : gettype ( $ this -> normalizer )) );
86
86
}
87
87
}
88
88
}
Original file line number Diff line number Diff line change @@ -52,10 +52,19 @@ public function testNormalizerCanBeSet()
52
52
53
53
/**
54
54
* @expectedException \InvalidArgumentException
55
- * @expectedExceptionMessage The "normalizer" parameter value is not a valid callable.
55
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("string" given) .
56
56
*/
57
57
public function testInvalidNormalizerThrowsException ()
58
58
{
59
59
new Email (array ('normalizer ' => 'Unknown Callable ' ));
60
60
}
61
+
62
+ /**
63
+ * @expectedException \InvalidArgumentException
64
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("stdClass" given).
65
+ */
66
+ public function testInvalidNormalizerObjectThrowsException ()
67
+ {
68
+ new Email (array ('normalizer ' => new \stdClass ()));
69
+ }
61
70
}
Original file line number Diff line number Diff line change @@ -28,10 +28,19 @@ public function testNormalizerCanBeSet()
28
28
29
29
/**
30
30
* @expectedException \InvalidArgumentException
31
- * @expectedExceptionMessage The "normalizer" parameter value is not a valid callable.
31
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("string" given) .
32
32
*/
33
33
public function testInvalidNormalizerThrowsException ()
34
34
{
35
35
new Ip (array ('normalizer ' => 'Unknown Callable ' ));
36
36
}
37
+
38
+ /**
39
+ * @expectedException \InvalidArgumentException
40
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("stdClass" given).
41
+ */
42
+ public function testInvalidNormalizerObjectThrowsException ()
43
+ {
44
+ new Ip (array ('normalizer ' => new \stdClass ()));
45
+ }
37
46
}
Original file line number Diff line number Diff line change @@ -28,10 +28,19 @@ public function testNormalizerCanBeSet()
28
28
29
29
/**
30
30
* @expectedException \InvalidArgumentException
31
- * @expectedExceptionMessage The "normalizer" parameter value is not a valid callable.
31
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("string" given) .
32
32
*/
33
33
public function testInvalidNormalizerThrowsException ()
34
34
{
35
35
new Length (array ('min ' => 0 , 'max ' => 10 , 'normalizer ' => 'Unknown Callable ' ));
36
36
}
37
+
38
+ /**
39
+ * @expectedException \InvalidArgumentException
40
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("stdClass" given).
41
+ */
42
+ public function testInvalidNormalizerObjectThrowsException ()
43
+ {
44
+ new Length (array ('min ' => 0 , 'max ' => 10 , 'normalizer ' => new \stdClass ()));
45
+ }
37
46
}
Original file line number Diff line number Diff line change @@ -28,10 +28,19 @@ public function testNormalizerCanBeSet()
28
28
29
29
/**
30
30
* @expectedException \InvalidArgumentException
31
- * @expectedExceptionMessage The "normalizer" parameter value is not a valid callable.
31
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("string" given) .
32
32
*/
33
33
public function testInvalidNormalizerThrowsException ()
34
34
{
35
35
new NotBlank (array ('normalizer ' => 'Unknown Callable ' ));
36
36
}
37
+
38
+ /**
39
+ * @expectedException \InvalidArgumentException
40
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("stdClass" given).
41
+ */
42
+ public function testInvalidNormalizerObjectThrowsException ()
43
+ {
44
+ new NotBlank (array ('normalizer ' => new \stdClass ()));
45
+ }
37
46
}
Original file line number Diff line number Diff line change @@ -95,10 +95,19 @@ public function testNormalizerCanBeSet()
95
95
96
96
/**
97
97
* @expectedException \InvalidArgumentException
98
- * @expectedExceptionMessage The "normalizer" parameter value is not a valid callable.
98
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("string" given) .
99
99
*/
100
100
public function testInvalidNormalizerThrowsException ()
101
101
{
102
102
new Regex (array ('pattern ' => '/^[0-9]+$/ ' , 'normalizer ' => 'Unknown Callable ' ));
103
103
}
104
+
105
+ /**
106
+ * @expectedException \InvalidArgumentException
107
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("stdClass" given).
108
+ */
109
+ public function testInvalidNormalizerObjectThrowsException ()
110
+ {
111
+ new Regex (array ('pattern ' => '/^[0-9]+$/ ' , 'normalizer ' => new \stdClass ()));
112
+ }
104
113
}
Original file line number Diff line number Diff line change @@ -28,10 +28,19 @@ public function testNormalizerCanBeSet()
28
28
29
29
/**
30
30
* @expectedException \InvalidArgumentException
31
- * @expectedExceptionMessage The "normalizer" parameter value is not a valid callable.
31
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("string" given) .
32
32
*/
33
33
public function testInvalidNormalizerThrowsException ()
34
34
{
35
35
new Url (array ('normalizer ' => 'Unknown Callable ' ));
36
36
}
37
+
38
+ /**
39
+ * @expectedException \InvalidArgumentException
40
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("stdClass" given).
41
+ */
42
+ public function testInvalidNormalizerObjectThrowsException ()
43
+ {
44
+ new Url (array ('normalizer ' => new \stdClass ()));
45
+ }
37
46
}
Original file line number Diff line number Diff line change @@ -28,10 +28,19 @@ public function testNormalizerCanBeSet()
28
28
29
29
/**
30
30
* @expectedException \InvalidArgumentException
31
- * @expectedExceptionMessage The "normalizer" parameter value is not a valid callable.
31
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("string" given) .
32
32
*/
33
33
public function testInvalidNormalizerThrowsException ()
34
34
{
35
35
new Uuid (array ('normalizer ' => 'Unknown Callable ' ));
36
36
}
37
+
38
+ /**
39
+ * @expectedException \InvalidArgumentException
40
+ * @expectedExceptionMessage The "normalizer" option must be a valid callable ("stdClass" given).
41
+ */
42
+ public function testInvalidNormalizerObjectThrowsException ()
43
+ {
44
+ new Uuid (array ('normalizer ' => new \stdClass ()));
45
+ }
37
46
}
You can’t perform that action at this time.
0 commit comments