-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathAvoidFeatureSetAttributeInRectorRuleTest.php
More file actions
34 lines (27 loc) · 1015 Bytes
/
AvoidFeatureSetAttributeInRectorRuleTest.php
File metadata and controls
34 lines (27 loc) · 1015 Bytes
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
33
34
<?php
declare(strict_types=1);
namespace Symplify\PHPStanRules\Tests\Rules\Rector\AvoidFeatureSetAttributeInRectorRule;
use Iterator;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use Symplify\PHPStanRules\Rules\Rector\AvoidFeatureSetAttributeInRectorRule;
final class AvoidFeatureSetAttributeInRectorRuleTest extends RuleTestCase
{
#[DataProvider('provideData')]
public function testRule(string $filePath, array $expectedErrorsWithLines): void
{
$this->analyse([$filePath], $expectedErrorsWithLines);
}
public static function provideData(): Iterator
{
yield [__DIR__ . '/Fixture/SetLocalAttribute.php', [[
sprintf(AvoidFeatureSetAttributeInRectorRule::ERROR_MESSAGE, 'some_attribute'), 11,
]]];
yield [__DIR__ . '/Fixture/SkipAllowedSetAttributesNode.php', []];
}
protected function getRule(): Rule
{
return new AvoidFeatureSetAttributeInRectorRule();
}
}