mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-20 23:41:57 +02:00
add test for #1225
This commit is contained in:
parent
2ce77be88d
commit
877c84fd59
31
tests/Issues/Issue1225/Fixture/fixture1225.php
Normal file
31
tests/Issues/Issue1225/Fixture/fixture1225.php
Normal 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([])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
18
tests/Issues/Issue1225/Issue1225Test.php
Normal file
18
tests/Issues/Issue1225/Issue1225Test.php
Normal 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';
|
||||
}
|
||||
}
|
3
tests/Issues/Issue1225/config/config1225.yaml
Normal file
3
tests/Issues/Issue1225/config/config1225.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
imports:
|
||||
# same as "--level underscore-to-namespace"
|
||||
- { resource: "../../../../config/level/twig/underscore-to-namespace.yaml" }
|
Loading…
x
Reference in New Issue
Block a user