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:
Tomas Votruba 2020-12-28 00:24:28 +01:00 committed by GitHub
parent 520335251d
commit a7544e85e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 114 deletions

View File

@ -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);
};

View File

@ -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
*/

View File

@ -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
{
/**

View File

@ -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);
}
}
?>

View File

@ -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
{
}
?>

View File

@ -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);
}
}
?>

View File

@ -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()

View 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);
}
}
?>

View File

@ -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()
{

View File

@ -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

View 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);
}
}