123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace PhpCsFixer\Tests\Fixer\Alias;
- use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
- final class MbStrFunctionsFixerTest extends AbstractFixerTestCase
- {
-
- public function testFix($expected, $input = null)
- {
- $this->doTest($expected, $input);
- }
- public function provideFixCases()
- {
- return [
- ['<?php $x = "strlen";'],
- ['<?php $x = Foo::strlen("bar");'],
- ['<?php $x = new strlen("bar");'],
- ['<?php $x = new \strlen("bar");'],
- ['<?php $x = new Foo\strlen("bar");'],
- ['<?php $x = Foo\strlen("bar");'],
- ['<?php $x = strlen::call("bar");'],
- ['<?php $x = $foo->strlen("bar");'],
- ['<?php $x = strlen();'],
- ['<?php $x = strlen($a, $b);'],
- ['<?php $x = mb_strlen("bar");', '<?php $x = strlen("bar");'],
- ['<?php $x = \mb_strlen("bar");', '<?php $x = \strlen("bar");'],
- ['<?php $x = mb_strtolower(mb_strstr("bar", "a"));', '<?php $x = strtolower(strstr("bar", "a"));'],
- ['<?php $x = mb_strtolower( \mb_strstr ("bar", "a"));', '<?php $x = strtolower( \strstr ("bar", "a"));'],
- ['<?php $x = mb_substr("bar", 2, 1);', '<?php $x = substr("bar", 2, 1);'],
- [
- '<?php
- interface Test
- {
- public function &strlen($a);
- public function strtolower($a);
- }',
- ],
- ];
- }
- }
|