Add namespaced function call test

This commit is contained in:
Tomas Votruba 2018-08-11 11:09:44 +02:00
parent 1db0b88115
commit 2783013a5b
4 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<?php
namespace Rector\Tests\FunctionToStaticCallRector;
class SomeClass
{
public function someMethod()
{
\AnotherStaticClass::render('template', []);
}
}

View File

@ -21,6 +21,7 @@ final class FunctionToMethodCallRectorTest extends AbstractRectorTestCase
public function provideWrongToFixedFiles(): Iterator
{
yield [__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc'];
yield [__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'];
}
protected function provideConfig(): string

View File

@ -0,0 +1,11 @@
<?php
namespace Rector\Tests\FunctionToStaticCallRector;
class SomeClass
{
public function someMethod()
{
\SomeNamespaced\view('template', []);
}
}

View File

@ -2,3 +2,4 @@ services:
Rector\Rector\Function_\FunctionToStaticCallRector:
$functionToMethodCall:
'view': ['SomeStaticClass', 'render']
'SomeNamespaced\view': ['AnotherStaticClass', 'render']