Skip to content

Commit d801518

Browse files
committed
minor #57490 [Validator]  fix test (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Validator]  fix test | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT update test after merging #57213 up Commits ------- f2883ba fix test
2 parents 5b80025 + f2883ba commit d801518

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Symfony/Component/Validator/Tests/Constraints/UniqueValidatorTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ public static function getInvalidFieldNames(): array
246246
/**
247247
* @dataProvider getInvalidCollectionValues
248248
*/
249-
public function testInvalidCollectionValues(array $value, array $fields)
249+
public function testInvalidCollectionValues(array $value, array $fields, string $expectedMessageParam)
250250
{
251251
$this->validator->validate($value, new Unique([
252252
'message' => 'myMessage',
253253
], fields: $fields));
254254

255255
$this->buildViolation('myMessage')
256-
->setParameter('{{ value }}', 'array')
256+
->setParameter('{{ value }}', $expectedMessageParam)
257257
->setCode(Unique::IS_NOT_UNIQUE)
258258
->assertRaised();
259259
}
@@ -264,23 +264,25 @@ public static function getInvalidCollectionValues(): array
264264
'unique string' => [[
265265
['lang' => 'eng', 'translation' => 'hi'],
266266
['lang' => 'eng', 'translation' => 'hello'],
267-
], ['lang']],
267+
], ['lang'], 'array'],
268268
'unique floats' => [[
269269
['latitude' => 51.509865, 'longitude' => -0.118092, 'poi' => 'capital'],
270270
['latitude' => 52.520008, 'longitude' => 13.404954],
271271
['latitude' => 51.509865, 'longitude' => -0.118092],
272-
], ['latitude', 'longitude']],
272+
], ['latitude', 'longitude'], 'array'],
273273
'unique int' => [[
274274
['id' => 1, 'email' => 'bar@email.com'],
275275
['id' => 1, 'email' => 'foo@email.com'],
276-
], ['id']],
276+
], ['id'], 'array'],
277277
'unique null' => [
278278
[null, null],
279279
[],
280+
'null',
280281
],
281282
'unique field null' => [
282283
[['nullField' => null], ['nullField' => null]],
283284
['nullField'],
285+
'array',
284286
],
285287
];
286288
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy