bug #37770 [String] We cannot have a "provides" function in test cases (derrabus)
This PR was merged into the 5.1 branch.
Discussion
----------
[String] We cannot have a "provides" function in test cases
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Part of #37564
| License | MIT
| Doc PR | N/A
Because of a change in PHPUnit 9.3 (see sebastianbergmann/phpunit#3936), we cannot have define a method named `provides` in test cases. And since php is case-insensitive regarding method calls, the method `provideS` used by the String component's `FunctionTest` will cause a fatal error. I have renamed it to work around that issue.
cc @fancyweb
Commits
-------
46e2a0c517
[String] We cannot have a "provides" function in test cases.
This commit is contained in:
commit
a8ea11b419
@ -20,14 +20,14 @@ use function Symfony\Component\String\s;
|
|||||||
final class FunctionsTest extends TestCase
|
final class FunctionsTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideS
|
* @dataProvider provideStrings
|
||||||
*/
|
*/
|
||||||
public function testS(AbstractString $expected, string $input)
|
public function testS(AbstractString $expected, string $input)
|
||||||
{
|
{
|
||||||
$this->assertEquals($expected, s($input));
|
$this->assertEquals($expected, s($input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideS()
|
public function provideStrings(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[new UnicodeString('foo'), 'foo'],
|
[new UnicodeString('foo'), 'foo'],
|
||||||
|
Reference in New Issue
Block a user