Skip to content

Commit

Permalink
bug #37770 [String] We cannot have a "provides" function in test case…
Browse files Browse the repository at this point in the history
…s (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
-------

46e2a0c [String] We cannot have a "provides" function in test cases.
  • Loading branch information
fabpot committed Aug 8, 2020
2 parents 1382001 + 46e2a0c commit a8ea11b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/String/Tests/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
final class FunctionsTest extends TestCase
{
/**
* @dataProvider provideS
* @dataProvider provideStrings
*/
public function testS(AbstractString $expected, string $input)
{
$this->assertEquals($expected, s($input));
}

public function provideS()
public function provideStrings(): array
{
return [
[new UnicodeString('foo'), 'foo'],
Expand Down

0 comments on commit a8ea11b

Please sign in to comment.