mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-13 03:52:15 +02:00
[NodeTypeResolver] add method argument type
This commit is contained in:
parent
9c9b5c8111
commit
8c3fc9a493
@ -35,28 +35,31 @@ final class PropertyTest extends AbstractContainerAwareTestCase
|
||||
$this->nodes = $this->standaloneTraverseNodeTraverser->traverse($nodes);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * $this->property;
|
||||
// */
|
||||
// public function testPropertyFetch(): void
|
||||
// {
|
||||
// /** @var PropertyFetch $propertyFetchNode */
|
||||
// $propertyFetchNode = $this->nodes[1]->stmts[1]->stmts[2]->stmts[0]->expr;
|
||||
// $this->assertSame(Html::class, $propertyFetchNode->getAttribute('type'));
|
||||
// }
|
||||
/**
|
||||
* $this->property;.
|
||||
*/
|
||||
public function testPropertyFetch(): void
|
||||
{
|
||||
/** @var PropertyFetch $propertyFetchNode */
|
||||
$propertyFetchNode = $this->nodes[1]->stmts[1]->stmts[2]->stmts[0]->expr;
|
||||
$this->assertSame(Html::class, $propertyFetchNode->getAttribute('type'));
|
||||
}
|
||||
|
||||
/**
|
||||
* $property;
|
||||
* $property;.
|
||||
*/
|
||||
public function testProperty(): void
|
||||
{
|
||||
$propertyNode = $this->nodes[1]->stmts[1]->stmts[0];
|
||||
$this->assertSame(Html::class, $propertyNode->getAttribute('type'));
|
||||
}
|
||||
//
|
||||
// public function testMethodParameter(): void
|
||||
// {
|
||||
// $this->assertTrue(true);
|
||||
// // $constructorVariableNode = $this->nodes[1]->stmts[1]->stmts[1]->params[0]->var;
|
||||
// }
|
||||
|
||||
/**
|
||||
* method(Type $parameter).
|
||||
*/
|
||||
public function testMethodParameter(): void
|
||||
{
|
||||
$constructorVariableNode = $this->nodes[1]->stmts[1]->stmts[1]->params[0]->var;
|
||||
$this->assertSame(Html::class, $constructorVariableNode->getAttribute('type'));
|
||||
}
|
||||
}
|
||||
|
@ -36,24 +36,22 @@ final class VariableTest extends AbstractContainerAwareTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* $variable
|
||||
* $variable.
|
||||
*/
|
||||
public function testVariable(): void
|
||||
{
|
||||
/** @var Variable $htmlVariableNode */
|
||||
$htmlVariableNode = $this->nodes[1]->stmts[1]->stmts[0]->stmts[0]->expr->var;
|
||||
$this->assertSame(Html::class, $htmlVariableNode->getAttribute('type'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* $newVariable = $variable;
|
||||
* $newVariable = $variable;.
|
||||
*/
|
||||
public function testReassignedVariable(): void
|
||||
{
|
||||
/** @var Variable $assignedVariableNode */
|
||||
$assignedVariableNode = $this->nodes[1]->stmts[1]->stmts[0]->stmts[1]->expr->var;
|
||||
$this->assertSame(Html::class, $assignedVariableNode->getAttribute('type'));
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user