Skip to content

Commit 08b34e1

Browse files
authored
refactor: simplify EveryTestHasSameNamespaceAsCoveredClass check (#71)
1 parent fadd7ed commit 08b34e1

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/TestCheck/EveryTestHasSameNamespaceAsCoveredClass.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function run(TestCase $testCaseContext): void
5353
));
5454
}
5555

56-
if ($matchesCoversNothing) {
56+
if ($matchesCoversNothing || $matchesCovers) {
5757
continue;
5858
}
5959

@@ -75,14 +75,6 @@ public function run(TestCase $testCaseContext): void
7575
continue;
7676
}
7777

78-
if (class_exists($classNameWithoutSuffix)) {
79-
continue;
80-
}
81-
82-
if ($coversMatches[0] !== []) {
83-
continue;
84-
}
85-
8678
$testCaseContext::fail(
8779
sprintf(
8880
'Test "%s" is in the wrong namespace, ' .

tests/TestCheck/Fixtures/EveryTestHasSameNamespaceAsCoveredClass/tests/CoversDefaultClassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Cdn77\TestUtils\Tests\Tests\TestCheck\Fixtures\EveryTestHasSameNamespaceAsCoveredClass;
66

77
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
8-
/** @coversDefaultClass Cdn77\TestUtils\Tests\TestCheck\Fixtures\EveryTestHasSameNamespaceAsCoveredClass\SameNamespace */
8+
/** @coversDefaultClass \Cdn77\TestUtils\Tests\TestCheck\Fixtures\EveryTestHasSameNamespaceAsCoveredClass\SameNamespace */
99
final class CoversDefaultClassTest
1010
{
1111
}

0 commit comments

Comments
 (0)