-
-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathRectorConfigTest.php
More file actions
32 lines (26 loc) · 1.02 KB
/
RectorConfigTest.php
File metadata and controls
32 lines (26 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
declare(strict_types=1);
namespace Rector\Tests\Config;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use Rector\Configuration\Option;
use Rector\Configuration\Parameter\SimpleParameterProvider;
use Rector\Symfony\Set\TwigSetList;
use Rector\Testing\PHPUnit\AbstractLazyTestCase;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector;
/**
* On macOS, this file order config cause this container read other tests' config.
* so, this #[RunTestsInSeparateProcesses] is needed.
*/
#[RunTestsInSeparateProcesses]
final class RectorConfigTest extends AbstractLazyTestCase
{
public function test(): void
{
$rectorConfig = $this->getContainer();
$rectorConfig->configure()
->withSets([TwigSetList::TWIG_134])
->withRules([ReturnTypeFromReturnNewRector::class])($rectorConfig);
// only collect root withRules()
$this->assertCount(1, SimpleParameterProvider::provideArrayParameter(Option::ROOT_STANDALONE_REGISTERED_RULES));
}
}