mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
Cleanup exclusion manager test (#5012)
* merge CODING_STYLE_ADVANCED to CODE_QUALITY_STIRCT * rename split ExclusionManager test to single one
This commit is contained in:
parent
520335251d
commit
a7544e85e1
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQualityStrict\Rector\If_\MoveOutMethodCallInsideIfConditionRector;
|
||||
use Rector\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector;
|
||||
use Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector;
|
||||
use Rector\Performance\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
@ -12,4 +13,5 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services->set(MoveOutMethodCallInsideIfConditionRector::class);
|
||||
$services->set(CountArrayToEmptyArrayComparisonRector::class);
|
||||
$services->set(MoveVariableDeclarationNearReferenceRector::class);
|
||||
$services->set(UseMessageVariableForSprintfInSymfonyStyleRector::class);
|
||||
};
|
||||
|
@ -86,11 +86,6 @@ final class SetList
|
||||
*/
|
||||
public const CODING_STYLE = __DIR__ . '/../../../../config/set/coding-style.php';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const CODING_STYLE_ADVANCED = __DIR__ . '/../../../../config/set/coding-style-advanced.php';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
@ -8,6 +8,10 @@ use PhpParser\Node;
|
||||
use Rector\Core\Contract\Exclusion\ExclusionCheckInterface;
|
||||
use Rector\Core\Contract\Rector\PhpRectorInterface;
|
||||
|
||||
/**
|
||||
* @todo move to symplify/skipper if grown enough
|
||||
* @see \Rector\Core\Tests\Exclusion\ExclusionManagerTest
|
||||
*/
|
||||
final class ExclusionManager
|
||||
{
|
||||
/**
|
||||
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
|
||||
final class DocblockOnParentBaseline
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
round(1 + 0);
|
||||
round(1 + 0);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
|
||||
final class DocblockOnParentBaseline
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
round(1);
|
||||
round(1);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
|
||||
final class DocblockOnSelfBaseline
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
|
||||
}
|
||||
public function bar()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
|
||||
final class DocblockOnSelfBaseline
|
||||
{
|
||||
}
|
||||
|
||||
?>
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
|
||||
final class OtherDocblocks
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
/**
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\AnotherRector
|
||||
*/
|
||||
round(1 + 0);
|
||||
|
||||
/** @noRector \Rector\DeadCode\Rector\Plus\AnotherRector */
|
||||
round(2 + 0);
|
||||
|
||||
/** @noRector */
|
||||
round(2 + 0);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
|
||||
final class OtherDocblocks
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
/**
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\AnotherRector
|
||||
*/
|
||||
round(1 + 0);
|
||||
|
||||
/** @noRector \Rector\DeadCode\Rector\Plus\AnotherRector */
|
||||
round(2);
|
||||
|
||||
/** @noRector */
|
||||
round(2 + 0);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check;
|
||||
namespace Rector\Core\Tests\Exclusion;
|
||||
|
||||
use Iterator;
|
||||
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
|
||||
@ -10,7 +10,10 @@ use Rector\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ExcludeByDocBlockExclusionCheckTest extends AbstractRectorTestCase
|
||||
/**
|
||||
* @see \Rector\Core\Exclusion\ExclusionManager
|
||||
*/
|
||||
final class ExclusionManagerTest extends AbstractRectorTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider provideData()
|
33
tests/Exclusion/Fixture/different-norector.php.inc
Normal file
33
tests/Exclusion/Fixture/different-norector.php.inc
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Fixture;
|
||||
|
||||
final class DifferentNorector
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
/**
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\AnotherRector
|
||||
*/
|
||||
round(1 + 0);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Fixture;
|
||||
|
||||
final class DifferentNorector
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
/**
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\AnotherRector
|
||||
*/
|
||||
round(1);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
namespace Rector\Core\Tests\Exclusion\Fixture;
|
||||
|
||||
final class DocblockOnParentNorector
|
||||
final class SkipDocblockOnParentNorector
|
||||
{
|
||||
public function foo()
|
||||
{
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Check\Fixture;
|
||||
namespace Rector\Core\Tests\Exclusion\Fixture;
|
||||
|
||||
final class DocblockOnSelfNoRector
|
||||
final class SkipDocblockOnSelfNoRector
|
||||
{
|
||||
/**
|
||||
* @noRector Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector
|
18
tests/Exclusion/Fixture/skip-other-docblocks.php.inc
Normal file
18
tests/Exclusion/Fixture/skip-other-docblocks.php.inc
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Exclusion\Fixture;
|
||||
|
||||
final class SkipOtherDocblocks
|
||||
{
|
||||
public function foo()
|
||||
{
|
||||
/**
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector
|
||||
* @noRector \Rector\DeadCode\Rector\Plus\AnotherRector
|
||||
*/
|
||||
round(1 + 0);
|
||||
|
||||
/** @noRector */
|
||||
round(2 + 0);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user