mirror of
https://github.com/rectorphp/rector.git
synced 2024-09-06 15:41:59 +00:00
test(RequestStaticValidateToInjectRector): add alias test case
This commit is contained in:
parent
3efa900de6
commit
a77daa3ede
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Laravel\Tests\Rector\StaticCall\RequestStaticValidateToInjectRector\Fixture;
|
||||
|
||||
use Request;
|
||||
|
||||
class SomeClassAlias
|
||||
{
|
||||
public function store()
|
||||
{
|
||||
$validatedData = Request::validate(['some_attribute' => 'required']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Laravel\Tests\Rector\StaticCall\RequestStaticValidateToInjectRector\Fixture;
|
||||
|
||||
use Request;
|
||||
|
||||
class SomeClassAlias
|
||||
{
|
||||
public function store(\Illuminate\Http\Request $request)
|
||||
{
|
||||
$validatedData = $request->validate(['some_attribute' => 'required']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -9,7 +9,7 @@ final class RequestStaticValidateToInjectRectorTest extends AbstractRectorTestCa
|
||||
{
|
||||
public function test(): void
|
||||
{
|
||||
$this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']);
|
||||
$this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture-alias.php.inc']);
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
|
Loading…
Reference in New Issue
Block a user