Skip to content

Commit

Permalink
minor #36680 [3.4][Inflector] Improve testSingularize() argument name…
Browse files Browse the repository at this point in the history
… (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
  • Loading branch information
fabpot committed May 4, 2020
2 parents 119b810 + 7540524 commit e3d2a50
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Symfony/Component/Inflector/Tests/InflectorTest.php
Expand Up @@ -160,15 +160,15 @@ public function singularizeProvider()
/**
* @dataProvider singularizeProvider
*/
public function testSingularize($plural, $singular)
public function testSingularize($plural, $expectedSingular)
{
$single = Inflector::singularize($plural);
if (\is_string($singular) && \is_array($single)) {
$this->fail("--- Expected\n`string`: ".$singular."\n+++ Actual\n`array`: ".implode(', ', $single));
} elseif (\is_array($singular) && \is_string($single)) {
$this->fail("--- Expected\n`array`: ".implode(', ', $singular)."\n+++ Actual\n`string`: ".$single);
$singular = Inflector::singularize($plural);
if (\is_string($expectedSingular) && \is_array($singular)) {
$this->fail("--- Expected\n`string`: ".$expectedSingular."\n+++ Actual\n`array`: ".implode(', ', $singular));
} elseif (\is_array($expectedSingular) && \is_string($singular)) {
$this->fail("--- Expected\n`array`: ".implode(', ', $expectedSingular)."\n+++ Actual\n`string`: ".$singular);
}

$this->assertEquals($singular, $single);
$this->assertEquals($expectedSingular, $singular);
}
}

0 comments on commit e3d2a50

Please sign in to comment.