Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8ea11b

Browse files
committed
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 ------- 46e2a0c [String] We cannot have a "provides" function in test cases.
2 parents 1382001 + 46e2a0c commit a8ea11b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/String/Tests/FunctionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
final class FunctionsTest extends TestCase
2121
{
2222
/**
23-
* @dataProvider provideS
23+
* @dataProvider provideStrings
2424
*/
2525
public function testS(AbstractString $expected, string $input)
2626
{
2727
$this->assertEquals($expected, s($input));
2828
}
2929

30-
public function provideS()
30+
public function provideStrings(): array
3131
{
3232
return [
3333
[new UnicodeString('foo'), 'foo'],

0 commit comments

Comments
 (0)