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 e3d2a50

Browse filesBrowse files
committed
minor #36680 [3.4][Inflector] Improve testSingularize() argument name (fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- [3.4][Inflector] Improve testSingularize() argument name | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | #36639 (comment) | License | MIT | Doc PR | - Follow up of #36639 on 3.4 to keep both tests methods synchronized. Commits ------- 7540524 [3.4][Inflector] Improve testSingularize() argument name
2 parents 119b810 + 7540524 commit e3d2a50
Copy full SHA for e3d2a50

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
@@ -160,15 +160,15 @@ public function singularizeProvider()
160160
/**
161161
* @dataProvider singularizeProvider
162162
*/
163-
public function testSingularize($plural, $singular)
163+
public function testSingularize($plural, $expectedSingular)
164164
{
165-
$single = Inflector::singularize($plural);
166-
if (\is_string($singular) && \is_array($single)) {
167-
$this->fail("--- Expected\n`string`: ".$singular."\n+++ Actual\n`array`: ".implode(', ', $single));
168-
} elseif (\is_array($singular) && \is_string($single)) {
169-
$this->fail("--- Expected\n`array`: ".implode(', ', $singular)."\n+++ Actual\n`string`: ".$single);
165+
$singular = Inflector::singularize($plural);
166+
if (\is_string($expectedSingular) && \is_array($singular)) {
167+
$this->fail("--- Expected\n`string`: ".$expectedSingular."\n+++ Actual\n`array`: ".implode(', ', $singular));
168+
} elseif (\is_array($expectedSingular) && \is_string($singular)) {
169+
$this->fail("--- Expected\n`array`: ".implode(', ', $expectedSingular)."\n+++ Actual\n`string`: ".$singular);
170170
}
171171

172-
$this->assertEquals($singular, $single);
172+
$this->assertEquals($expectedSingular, $singular);
173173
}
174174
}

0 commit comments

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