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 106408b

Browse filesBrowse files
committed
minor #36639 [Inflector] Fix testPluralize() arguments names (fancyweb)
This PR was merged into the 4.4 branch. Discussion ---------- [Inflector] Fix testPluralize() arguments names | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This is minor but the testPluralize() method arguments names are inversed ($plural contains the singular, $singular contains the plural, etc.). I lost some time on this because I thought the test was wrong 😅 I guess it's better to have a test that is easier to understand. Commits ------- fb42f98 [Inflector] Fix testPluralize() arguments names
2 parents a5ae434 + fb42f98 commit 106408b
Copy full SHA for 106408b

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+7
-7
lines changed

‎src/Symfony/Component/Inflector/Tests/InflectorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Inflector/Tests/InflectorTest.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,15 @@ public function testSingularize($plural, $singular)
309309
/**
310310
* @dataProvider pluralizeProvider
311311
*/
312-
public function testPluralize($plural, $singular)
312+
public function testPluralize($singular, $expectedPlural)
313313
{
314-
$single = Inflector::pluralize($plural);
315-
if (\is_string($singular) && \is_array($single)) {
316-
$this->fail("--- Expected\n`string`: ".$singular."\n+++ Actual\n`array`: ".implode(', ', $single));
317-
} elseif (\is_array($singular) && \is_string($single)) {
318-
$this->fail("--- Expected\n`array`: ".implode(', ', $singular)."\n+++ Actual\n`string`: ".$single);
314+
$plural = Inflector::pluralize($singular);
315+
if (\is_string($expectedPlural) && \is_array($plural)) {
316+
$this->fail("--- Expected\n`string`: ".$expectedPlural."\n+++ Actual\n`array`: ".implode(', ', $plural));
317+
} elseif (\is_array($expectedPlural) && \is_string($plural)) {
318+
$this->fail("--- Expected\n`array`: ".implode(', ', $expectedPlural)."\n+++ Actual\n`string`: ".$plural);
319319
}
320320

321-
$this->assertEquals($singular, $single);
321+
$this->assertEquals($expectedPlural, $plural);
322322
}
323323
}

0 commit comments

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