File tree Expand file tree Collapse file tree
tests/Testing/ResetSourceLocator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Testing \ResetSourceLocator \Fixture ;
4+
5+ function some_function ()
6+ {
7+ }
8+
9+ ?>
10+ -----
11+ <?php
12+
13+ namespace Rector \Tests \Testing \ResetSourceLocator \Fixture ;
14+
15+ function some_function (): void
16+ {
17+ }
18+
19+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \Tests \Testing \ResetSourceLocator ;
6+
7+ use PHPUnit \Framework \Attributes \Depends ;
8+ use Rector \NodeTypeResolver \Reflection \BetterReflection \SourceLocatorProvider \DynamicSourceLocatorProvider ;
9+ use Rector \Testing \PHPUnit \AbstractRectorTestCase ;
10+
11+ final class ResetSourceLocatorTest extends AbstractRectorTestCase
12+ {
13+ public function testProcessFixture (): void
14+ {
15+ $ this ->doTestFile (__DIR__ . '/Fixture/some_function.php.inc ' );
16+ }
17+
18+ #[Depends('testProcessFixture ' )]
19+ public function testNextTestDoesNotLocateDeletedInputFile (): void
20+ {
21+ $ dynamicSourceLocatorProvider = $ this ->make (DynamicSourceLocatorProvider::class);
22+
23+ $ this ->assertTrue ($ dynamicSourceLocatorProvider ->arePathsEmpty ());
24+ }
25+
26+ public function provideConfigFilePath (): string
27+ {
28+ return __DIR__ . '/config/configured_rule.php ' ;
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Rector \Config \RectorConfig ;
6+ use Rector \TypeDeclaration \Rector \Function_ \AddFunctionVoidReturnTypeWhereNoReturnRector ;
7+
8+ return RectorConfig::configure ()
9+ ->withRules ([AddFunctionVoidReturnTypeWhereNoReturnRector::class]);
You can’t perform that action at this time.
0 commit comments