add test for #1225

This commit is contained in:
Tomas Votruba 2019-03-18 15:48:42 +01:00
parent 2ce77be88d
commit 877c84fd59
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?php
namespace Rector\Tests\Issues\Issue1225\Fixture;
final class SomeController
{
public function view($id = null)
{
$this->safeTwigEnvironment = new \Twig_Environment(
new \Twig_Loader_Array([])
);
}
}
?>
-----
<?php
namespace Rector\Tests\Issues\Issue1225\Fixture;
final class SomeController
{
public function view($id = null)
{
$this->safeTwigEnvironment = new \Twig\Environment(
new \Twig\Loader\ArrayLoader([])
);
}
}
?>

View File

@ -0,0 +1,18 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Issues\Issue1225;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
final class Issue1225Test extends AbstractRectorTestCase
{
public function test(): void
{
$this->doTestFiles([__DIR__ . '/Fixture/fixture1225.php']);
}
protected function provideConfig(): string
{
return __DIR__ . '/config/config1225.yaml';
}
}

View File

@ -0,0 +1,3 @@
imports:
# same as "--level underscore-to-namespace"
- { resource: "../../../../config/level/twig/underscore-to-namespace.yaml" }