mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 16:30:51 +00:00
[SymfonyExtra] add test to GetterToPropertyRector
This commit is contained in:
parent
ffa4d0c6ef
commit
e4ef19b2d1
|
@ -0,0 +1,19 @@
|
|||
<?php declare (strict_types=1);
|
||||
|
||||
class ClassWithNamedService implements ContainerAwareInterface
|
||||
{
|
||||
/**
|
||||
* @var stdClass
|
||||
*/
|
||||
private $stdClass;
|
||||
public function __construct(stdClass $stdClass)
|
||||
{
|
||||
$this->stdClass = $stdClass;
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
$this->renderTwig([
|
||||
'posts' => $this->stdClass->callMe()
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -23,6 +23,11 @@ final class Test extends AbstractRectorTestCase
|
|||
__DIR__ . '/Wrong/wrong3.php.inc',
|
||||
__DIR__ . '/Correct/correct3.php.inc'
|
||||
);
|
||||
|
||||
$this->doTestFileMatchesExpectedContent(
|
||||
__DIR__ . '/Wrong/wrong4.php.inc',
|
||||
__DIR__ . '/Correct/correct4.php.inc'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<?php declare (strict_types=1);
|
||||
|
||||
class ClassWithNamedService implements ContainerAwareInterface
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
$this->renderTwig([
|
||||
'posts' => $this->get('some_service')->callMe()
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user