Skip to content

Commit

Permalink
Fix: Imports
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jun 26, 2023
1 parent bb232c5 commit bb464b5
Show file tree
Hide file tree
Showing 28 changed files with 160 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Ergebnis\PHPStan\Rules\Test\Fixture\Classes\NoExtendsRule\Success;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework;

/**
* @internal
*
* @coversNothing
*/
final class ClassExtendingPhpUnitFrameworkTestCase extends TestCase
final class ClassExtendingPhpUnitFrameworkTestCase extends Framework\TestCase
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Ergebnis\PHPStan\Rules\Test\Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Success;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework;

/**
* @internal
*
* @coversNothing
*/
final class ClassExtendingPhpUnitFrameworkTestCase extends TestCase
final class ClassExtendingPhpUnitFrameworkTestCase extends Framework\TestCase
{
}
21 changes: 10 additions & 11 deletions test/Integration/Classes/FinalRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@

namespace Ergebnis\PHPStan\Rules\Test\Integration\Classes;

use Ergebnis\PHPStan\Rules\Classes\FinalRule;
use Ergebnis\PHPStan\Rules\Test\Fixture;
use Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase;
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;

/**
* @internal
*
* @covers \Ergebnis\PHPStan\Rules\Classes\FinalRule
*/
final class FinalRuleTest extends AbstractTestCase
final class FinalRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
{
Expand Down Expand Up @@ -57,7 +56,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRule\Failure\AbstractClass::class,
Test\Fixture\Classes\FinalRule\Failure\AbstractClass::class,
),
7,
],
Expand All @@ -67,7 +66,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRule\Failure\NeitherAbstractNorFinalClass::class,
Test\Fixture\Classes\FinalRule\Failure\NeitherAbstractNorFinalClass::class,
),
7,
],
Expand All @@ -77,7 +76,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutEntityAnnotationInInlineDocBlock::class,
Test\Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutEntityAnnotationInInlineDocBlock::class,
),
8,
],
Expand All @@ -87,7 +86,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutEntityAnnotationInMultilineDocBlock::class,
Test\Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutEntityAnnotationInMultilineDocBlock::class,
),
12,
],
Expand All @@ -97,7 +96,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutOrmEntityAnnotationInInlineDocBlock::class,
Test\Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutOrmEntityAnnotationInInlineDocBlock::class,
),
8,
],
Expand All @@ -107,7 +106,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutOrmEntityAnnotationInMultilineDocBlock::class,
Test\Fixture\Classes\FinalRule\Failure\NonFinalClassWithoutOrmEntityAnnotationInMultilineDocBlock::class,
),
12,
],
Expand All @@ -124,7 +123,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable

protected function getRule(): Rule
{
return new FinalRule(
return new Classes\FinalRule(
false,
[],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@

namespace Ergebnis\PHPStan\Rules\Test\Integration\Classes;

use Ergebnis\PHPStan\Rules\Classes\FinalRule;
use Ergebnis\PHPStan\Rules\Test\Fixture;
use Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase;
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;

/**
* @internal
*
* @covers \Ergebnis\PHPStan\Rules\Classes\FinalRule
*/
final class FinalRuleWithAbstractClassesAllowedTest extends AbstractTestCase
final class FinalRuleWithAbstractClassesAllowedTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
{
Expand Down Expand Up @@ -52,7 +51,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is neither abstract nor final.',
Fixture\Classes\FinalRuleWithAbstractClassesAllowed\Failure\NeitherAbstractNorFinalClass::class,
Test\Fixture\Classes\FinalRuleWithAbstractClassesAllowed\Failure\NeitherAbstractNorFinalClass::class,
),
7,
],
Expand All @@ -69,7 +68,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable

protected function getRule(): Rule
{
return new FinalRule(
return new Classes\FinalRule(
true,
[],
);
Expand Down
17 changes: 8 additions & 9 deletions test/Integration/Classes/FinalRuleWithAttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

namespace Ergebnis\PHPStan\Rules\Test\Integration\Classes;

use Ergebnis\PHPStan\Rules\Classes\FinalRule;
use Ergebnis\PHPStan\Rules\Test\Fixture;
use Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase;
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;

/**
Expand All @@ -25,7 +24,7 @@
*
* @requires PHP 8.0
*/
final class FinalRuleWithAttributesTest extends AbstractTestCase
final class FinalRuleWithAttributesTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
{
Expand All @@ -52,7 +51,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedDoctrineOrmMappingEntityAttribute::class,
Test\Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedDoctrineOrmMappingEntityAttribute::class,
),
7,
],
Expand All @@ -62,7 +61,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedEntityAttribute::class,
Test\Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedEntityAttribute::class,
),
7,
],
Expand All @@ -72,7 +71,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedOrmEntityAttribute::class,
Test\Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedOrmEntityAttribute::class,
),
7,
],
Expand All @@ -82,7 +81,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedOrmMappingEntityAttribute::class,
Test\Fixture\Classes\FinalRuleWithAttributes\Failure\NonFinalClassWithUnqualifiedOrmMappingEntityAttribute::class,
),
7,
],
Expand All @@ -99,7 +98,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable

protected function getRule(): Rule
{
return new FinalRule(
return new Classes\FinalRule(
false,
[],
);
Expand Down
15 changes: 7 additions & 8 deletions test/Integration/Classes/FinalRuleWithExcludedClassNamesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@

namespace Ergebnis\PHPStan\Rules\Test\Integration\Classes;

use Ergebnis\PHPStan\Rules\Classes\FinalRule;
use Ergebnis\PHPStan\Rules\Test\Fixture;
use Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase;
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;

/**
* @internal
*
* @covers \Ergebnis\PHPStan\Rules\Classes\FinalRule
*/
final class FinalRuleWithExcludedClassNamesTest extends AbstractTestCase
final class FinalRuleWithExcludedClassNamesTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
{
Expand Down Expand Up @@ -52,7 +51,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRuleWithExcludedClassNames\Failure\AbstractClass::class,
Test\Fixture\Classes\FinalRuleWithExcludedClassNames\Failure\AbstractClass::class,
),
7,
],
Expand All @@ -62,7 +61,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class %s is not final.',
Fixture\Classes\FinalRuleWithExcludedClassNames\Failure\NeitherAbstractNorFinalClass::class,
Test\Fixture\Classes\FinalRuleWithExcludedClassNames\Failure\NeitherAbstractNorFinalClass::class,
),
7,
],
Expand All @@ -79,10 +78,10 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable

protected function getRule(): Rule
{
return new FinalRule(
return new Classes\FinalRule(
false,
[
Fixture\Classes\FinalRuleWithExcludedClassNames\Success\NeitherAbstractNorFinalClassButWhitelisted::class,
Test\Fixture\Classes\FinalRuleWithExcludedClassNames\Success\NeitherAbstractNorFinalClassButWhitelisted::class,
],
);
}
Expand Down
15 changes: 7 additions & 8 deletions test/Integration/Classes/NoExtendsRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@

namespace Ergebnis\PHPStan\Rules\Test\Integration\Classes;

use Ergebnis\PHPStan\Rules\Classes\NoExtendsRule;
use Ergebnis\PHPStan\Rules\Test\Fixture;
use Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase;
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;

/**
* @internal
*
* @covers \Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
*/
final class NoExtendsRuleTest extends AbstractTestCase
final class NoExtendsRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
{
Expand All @@ -50,8 +49,8 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class "%s" is not allowed to extend "%s".',
Fixture\Classes\NoExtendsRule\Failure\ClassExtendingOtherClass::class,
Fixture\Classes\NoExtendsRule\Failure\OtherClass::class,
Test\Fixture\Classes\NoExtendsRule\Failure\ClassExtendingOtherClass::class,
Test\Fixture\Classes\NoExtendsRule\Failure\OtherClass::class,
),
7,
],
Expand All @@ -61,7 +60,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Anonymous class is not allowed to extend "%s".',
Fixture\Classes\NoExtendsRule\Failure\OtherClass::class,
Test\Fixture\Classes\NoExtendsRule\Failure\OtherClass::class,
),
7,
],
Expand All @@ -78,6 +77,6 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable

protected function getRule(): Rule
{
return new NoExtendsRule([]);
return new Classes\NoExtendsRule([]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@

namespace Ergebnis\PHPStan\Rules\Test\Integration\Classes;

use Ergebnis\PHPStan\Rules\Classes\NoExtendsRule;
use Ergebnis\PHPStan\Rules\Test\Fixture;
use Ergebnis\PHPStan\Rules\Test\Integration\AbstractTestCase;
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;

/**
* @internal
*
* @covers \Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
*/
final class NoExtendsRuleWithClassesAllowedToBeExtendedTest extends AbstractTestCase
final class NoExtendsRuleWithClassesAllowedToBeExtendedTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
{
Expand Down Expand Up @@ -52,8 +51,8 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Class "%s" is not allowed to extend "%s".',
Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Failure\ClassExtendingOtherClass::class,
Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Failure\OtherClass::class,
Test\Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Failure\ClassExtendingOtherClass::class,
Test\Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Failure\OtherClass::class,
),
7,
],
Expand All @@ -63,7 +62,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
[
\sprintf(
'Anonymous class is not allowed to extend "%s".',
Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Failure\OtherClass::class,
Test\Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Failure\OtherClass::class,
),
7,
],
Expand All @@ -80,8 +79,8 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable

protected function getRule(): Rule
{
return new NoExtendsRule([
Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Success\ClassAllowedToBeExtended::class,
return new Classes\NoExtendsRule([
Test\Fixture\Classes\NoExtendsRuleWithClassesAllowedToBeExtended\Success\ClassAllowedToBeExtended::class,
]);
}
}
Loading

0 comments on commit bb464b5

Please sign in to comment.