@@ -59,15 +59,15 @@ public static function getValidValues()
59
59
/**
60
60
* @dataProvider getInvalidValues
61
61
*/
62
- public function testInvalidValues ($ value )
62
+ public function testInvalidValues ($ value, $ expectedMessageParam )
63
63
{
64
64
$ constraint = new Unique ([
65
65
'message ' => 'myMessage ' ,
66
66
]);
67
67
$ this ->validator ->validate ($ value , $ constraint );
68
68
69
69
$ this ->buildViolation ('myMessage ' )
70
- ->setParameter ('{{ value }} ' , ' array ' )
70
+ ->setParameter ('{{ value }} ' , $ expectedMessageParam )
71
71
->setCode (Unique::IS_NOT_UNIQUE )
72
72
->assertRaised ();
73
73
}
@@ -77,12 +77,12 @@ public static function getInvalidValues()
77
77
$ object = new \stdClass ();
78
78
79
79
return [
80
- yield 'not unique booleans ' => [[true , true ]],
81
- yield 'not unique integers ' => [[1 , 2 , 3 , 3 ]],
82
- yield 'not unique floats ' => [[0.1 , 0.2 , 0.1 ]],
83
- yield 'not unique string ' => [['a ' , 'b ' , 'a ' ]],
84
- yield 'not unique arrays ' => [[[1 , 1 ], [2 , 3 ], [1 , 1 ]]],
85
- yield 'not unique objects ' => [[$ object , $ object ]],
80
+ yield 'not unique booleans ' => [[true , true ], ' true ' ],
81
+ yield 'not unique integers ' => [[1 , 2 , 3 , 3 ], 3 ],
82
+ yield 'not unique floats ' => [[0.1 , 0.2 , 0.1 ], 0.1 ],
83
+ yield 'not unique string ' => [['a ' , 'b ' , 'a ' ], ' "a" ' ],
84
+ yield 'not unique arrays ' => [[[1 , 1 ], [2 , 3 ], [1 , 1 ]], ' array ' ],
85
+ yield 'not unique objects ' => [[$ object , $ object ], ' object ' ],
86
86
];
87
87
}
88
88
@@ -95,7 +95,7 @@ public function testInvalidValueNamed()
95
95
$ this ->validator ->validate ([1 , 2 , 3 , 3 ], $ constraint );
96
96
97
97
$ this ->buildViolation ('myMessage ' )
98
- ->setParameter ('{{ value }} ' , 'array ' )
98
+ ->setParameter ('{{ value }} ' , '3 ' )
99
99
->setCode (Unique::IS_NOT_UNIQUE )
100
100
->assertRaised ();
101
101
}
@@ -176,7 +176,7 @@ public function testExpectsInvalidNonStrictComparison()
176
176
]));
177
177
178
178
$ this ->buildViolation ('myMessage ' )
179
- ->setParameter ('{{ value }} ' , 'array ' )
179
+ ->setParameter ('{{ value }} ' , '1 ' )
180
180
->setCode (Unique::IS_NOT_UNIQUE )
181
181
->assertRaised ();
182
182
}
@@ -206,7 +206,7 @@ public function testExpectsInvalidCaseInsensitiveComparison()
206
206
]));
207
207
208
208
$ this ->buildViolation ('myMessage ' )
209
- ->setParameter ('{{ value }} ' , 'array ' )
209
+ ->setParameter ('{{ value }} ' , '"hello" ' )
210
210
->setCode (Unique::IS_NOT_UNIQUE )
211
211
->assertRaised ();
212
212
}
0 commit comments