mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 04:03:55 +01:00
Merge pull request #1178 from azdanov/lara-request-alias
[Laravel] add alias test case for RequestStaticValidateToInjectRector
This commit is contained in:
commit
ceca9df4cc
@ -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…
x
Reference in New Issue
Block a user