make code local for PerNodeTypeResolverTest

This commit is contained in:
Tomas Votruba 2018-04-08 18:16:22 +02:00
parent ca0738595a
commit d1cf1f465d
2 changed files with 36 additions and 31 deletions

View File

@ -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
{
}

View File

@ -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',
// ]],
];
}
}