Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 43b453b

Browse filesBrowse files
committed
[Validator] removed usage of deprecated getMessageParameters() and getMessagePluralization() in unit tests
1 parent b5af692 commit 43b453b
Copy full SHA for 43b453b

File tree

Expand file treeCollapse file tree

3 files changed

+52
-52
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+52
-52
lines changed

‎src/Symfony/Component/Validator/Tests/Validator/Abstract2Dot5ApiTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Validator/Abstract2Dot5ApiTest.php
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ public function testValidateInSeparateContext()
155155
$test->assertCount(1, $violations);
156156
$test->assertSame('Message value', $violations[0]->getMessage());
157157
$test->assertSame('Message %param%', $violations[0]->getMessageTemplate());
158-
$test->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
158+
$test->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
159159
$test->assertSame('', $violations[0]->getPropertyPath());
160160
// The root is different as we're in a new context
161161
$test->assertSame($entity->reference, $violations[0]->getRoot());
162162
$test->assertSame($entity->reference, $violations[0]->getInvalidValue());
163-
$test->assertNull($violations[0]->getMessagePluralization());
163+
$test->assertNull($violations[0]->getPlural());
164164
$test->assertNull($violations[0]->getCode());
165165

166166
// Verify that this method is called
@@ -252,11 +252,11 @@ public function testValidateInContext()
252252
$this->assertCount(1, $violations);
253253
$this->assertSame('Message value', $violations[0]->getMessage());
254254
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
255-
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
255+
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
256256
$this->assertSame('subpath', $violations[0]->getPropertyPath());
257257
$this->assertSame($entity, $violations[0]->getRoot());
258258
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
259-
$this->assertNull($violations[0]->getMessagePluralization());
259+
$this->assertNull($violations[0]->getPlural());
260260
$this->assertNull($violations[0]->getCode());
261261
}
262262

@@ -316,11 +316,11 @@ public function testValidateArrayInContext()
316316
$this->assertCount(1, $violations);
317317
$this->assertSame('Message value', $violations[0]->getMessage());
318318
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
319-
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
319+
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
320320
$this->assertSame('subpath[key]', $violations[0]->getPropertyPath());
321321
$this->assertSame($entity, $violations[0]->getRoot());
322322
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
323-
$this->assertNull($violations[0]->getMessagePluralization());
323+
$this->assertNull($violations[0]->getPlural());
324324
$this->assertNull($violations[0]->getCode());
325325
}
326326

@@ -355,11 +355,11 @@ public function testTraverseTraversableByDefault()
355355
$this->assertCount(1, $violations);
356356
$this->assertSame('Message value', $violations[0]->getMessage());
357357
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
358-
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
358+
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
359359
$this->assertSame('[key]', $violations[0]->getPropertyPath());
360360
$this->assertSame($traversable, $violations[0]->getRoot());
361361
$this->assertSame($entity, $violations[0]->getInvalidValue());
362-
$this->assertNull($violations[0]->getMessagePluralization());
362+
$this->assertNull($violations[0]->getPlural());
363363
$this->assertNull($violations[0]->getCode());
364364
}
365365

@@ -527,11 +527,11 @@ public function testAddCustomizedViolation()
527527
$this->assertCount(1, $violations);
528528
$this->assertSame('Message value', $violations[0]->getMessage());
529529
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
530-
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
530+
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
531531
$this->assertSame('', $violations[0]->getPropertyPath());
532532
$this->assertSame($entity, $violations[0]->getRoot());
533533
$this->assertSame('Invalid value', $violations[0]->getInvalidValue());
534-
$this->assertSame(2, $violations[0]->getMessagePluralization());
534+
$this->assertSame(2, $violations[0]->getPlural());
535535
$this->assertSame(42, $violations[0]->getCode());
536536
}
537537

‎src/Symfony/Component/Validator/Tests/Validator/AbstractLegacyApiTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Validator/AbstractLegacyApiTest.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ public function testValidateInContext()
166166
$this->assertCount(1, $violations);
167167
$this->assertSame('Message value', $violations[0]->getMessage());
168168
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
169-
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
169+
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
170170
$this->assertSame('subpath', $violations[0]->getPropertyPath());
171171
$this->assertSame($entity, $violations[0]->getRoot());
172172
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
173-
$this->assertNull($violations[0]->getMessagePluralization());
173+
$this->assertNull($violations[0]->getPlural());
174174
$this->assertNull($violations[0]->getCode());
175175
}
176176

@@ -224,11 +224,11 @@ public function testValidateArrayInContext()
224224
$this->assertCount(1, $violations);
225225
$this->assertSame('Message value', $violations[0]->getMessage());
226226
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
227-
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
227+
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
228228
$this->assertSame('subpath[key]', $violations[0]->getPropertyPath());
229229
$this->assertSame($entity, $violations[0]->getRoot());
230230
$this->assertSame($entity->reference, $violations[0]->getInvalidValue());
231-
$this->assertNull($violations[0]->getMessagePluralization());
231+
$this->assertNull($violations[0]->getPlural());
232232
$this->assertNull($violations[0]->getCode());
233233
}
234234

@@ -254,11 +254,11 @@ public function testAddCustomizedViolation()
254254
$this->assertCount(1, $violations);
255255
$this->assertSame('Message value', $violations[0]->getMessage());
256256
$this->assertSame('Message %param%', $violations[0]->getMessageTemplate());
257-
$this->assertSame(array('%param%' => 'value'), $violations[0]->getMessageParameters());
257+
$this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters());
258258
$this->assertSame('', $violations[0]->getPropertyPath());
259259
$this->assertSame($entity, $violations[0]->getRoot());
260260
$this->assertSame('Invalid value', $violations[0]->getInvalidValue());
261-
$this->assertSame(2, $violations[0]->getMessagePluralization());
261+
$this->assertSame(2, $violations[0]->getPlural());
262262
$this->assertSame('Code', $violations[0]->getCode());
263263
}
264264

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.