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 | https://github.com/symfony/symfony/pull/36639#discussion_r418192900
| License | MIT
| Doc PR | -
Follow up of https://github.com/symfony/symfony/pull/36639 on 3.4 to keep both tests methods synchronized.
Commits
-------
75405247be
[3.4][Inflector] Improve testSingularize() argument name
This commit is contained in:
commit
e3d2a50c35
@ -160,15 +160,15 @@ class InflectorTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* @dataProvider singularizeProvider
|
* @dataProvider singularizeProvider
|
||||||
*/
|
*/
|
||||||
public function testSingularize($plural, $singular)
|
public function testSingularize($plural, $expectedSingular)
|
||||||
{
|
{
|
||||||
$single = Inflector::singularize($plural);
|
$singular = Inflector::singularize($plural);
|
||||||
if (\is_string($singular) && \is_array($single)) {
|
if (\is_string($expectedSingular) && \is_array($singular)) {
|
||||||
$this->fail("--- Expected\n`string`: ".$singular."\n+++ Actual\n`array`: ".implode(', ', $single));
|
$this->fail("--- Expected\n`string`: ".$expectedSingular."\n+++ Actual\n`array`: ".implode(', ', $singular));
|
||||||
} elseif (\is_array($singular) && \is_string($single)) {
|
} elseif (\is_array($expectedSingular) && \is_string($singular)) {
|
||||||
$this->fail("--- Expected\n`array`: ".implode(', ', $singular)."\n+++ Actual\n`string`: ".$single);
|
$this->fail("--- Expected\n`array`: ".implode(', ', $expectedSingular)."\n+++ Actual\n`string`: ".$singular);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertEquals($singular, $single);
|
$this->assertEquals($expectedSingular, $singular);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user