mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 04:03:55 +01:00
make code local for PerNodeTypeResolverTest
This commit is contained in:
parent
ca0738595a
commit
d1cf1f465d
@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Nette\Config\Configurator;
|
||||
|
||||
class SomeClass extends Configurator
|
||||
class SomeClass extends AnotherClass
|
||||
{
|
||||
public function createContainer()
|
||||
{
|
||||
@ -14,3 +12,14 @@ class SomeClass extends Configurator
|
||||
return $this->createAnotherContainer();
|
||||
}
|
||||
}
|
||||
|
||||
class AnotherClass extends AnotherParentClass
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class AnotherParentClass
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
@ -16,10 +16,6 @@ final class MethodCallTypeResolverTest extends AbstractNodeTypeResolverTest
|
||||
*/
|
||||
public function test(string $file, int $position, array $expectedTypes): void
|
||||
{
|
||||
if (PHP_VERSION >= '7.2.0') {
|
||||
$this->markTestSkipped('This test needs PHP 7.1 or lower.');
|
||||
}
|
||||
|
||||
/** @var MethodCall[] $methodCallNodes */
|
||||
$methodCallNodes = $this->getNodesForFileOfType($file, MethodCall::class);
|
||||
$methodCallNode = $methodCallNodes[$position];
|
||||
@ -36,31 +32,31 @@ final class MethodCallTypeResolverTest extends AbstractNodeTypeResolverTest
|
||||
# on self call
|
||||
[__DIR__ . '/MethodCallSource/OnSelfCall.php.inc', 0, [
|
||||
'SomeClass',
|
||||
'Nette\Config\Configurator',
|
||||
'Nette\Object',
|
||||
]],
|
||||
[__DIR__ . '/MethodCallSource/OnSelfCall.php.inc', 1, [
|
||||
'SomeClass',
|
||||
'Nette\Config\Configurator',
|
||||
'Nette\Object',
|
||||
]],
|
||||
# on method call
|
||||
[__DIR__ . '/MethodCallSource/OnMethodCallCall.php.inc', 0, ['Nette\DI\Container']],
|
||||
# on variable call
|
||||
[__DIR__ . '/MethodCallSource/OnVariableCall.php.inc', 0, [
|
||||
'Nette\Config\Configurator',
|
||||
'Nette\Object',
|
||||
]],
|
||||
# on property call
|
||||
[__DIR__ . '/MethodCallSource/OnPropertyCall.php.inc', 0, [
|
||||
'Nette\Config\Configurator',
|
||||
'Nette\Object',
|
||||
]],
|
||||
# on magic class call
|
||||
[__DIR__ . '/MethodCallSource/OnMagicClassCall.php.inc', 0, [
|
||||
'Nette\Config\Configurator',
|
||||
'Nette\Object',
|
||||
'AnotherClass',
|
||||
'AnotherParentClass',
|
||||
]],
|
||||
// [__DIR__ . '/MethodCallSource/OnSelfCall.php.inc', 1, [
|
||||
// 'SomeClass',
|
||||
// 'Nette\Config\Configurator',
|
||||
// 'Nette\Object',
|
||||
// ]],
|
||||
// # on method call
|
||||
// [__DIR__ . '/MethodCallSource/OnMethodCallCall.php.inc', 0, ['Nette\DI\Container']],
|
||||
// # on variable call
|
||||
// [__DIR__ . '/MethodCallSource/OnVariableCall.php.inc', 0, [
|
||||
// 'Nette\Config\Configurator',
|
||||
// 'Nette\Object',
|
||||
// ]],
|
||||
// # on property call
|
||||
// [__DIR__ . '/MethodCallSource/OnPropertyCall.php.inc', 0, [
|
||||
// 'Nette\Config\Configurator',
|
||||
// 'Nette\Object',
|
||||
// ]],
|
||||
// # on magic class call
|
||||
// [__DIR__ . '/MethodCallSource/OnMagicClassCall.php.inc', 0, [
|
||||
// 'Nette\Config\Configurator',
|
||||
// 'Nette\Object',
|
||||
// ]],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user