Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: fix checking test class extends PhpCsFixer\Tests\TestCase #7567

Merged
merged 5 commits into from Dec 16, 2023
Merged

DX: fix checking test class extends PhpCsFixer\Tests\TestCase #7567

merged 5 commits into from Dec 16, 2023

Conversation

kubawerlos
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Dec 15, 2023

Coverage Status

coverage: 94.801%. remained the same
when pulling d068146 on 6b7562617765726c6f73:dx_fix_checking_for_extends
into 290962a on PHP-CS-Fixer:master.

@kubawerlos kubawerlos enabled auto-merge (squash) December 15, 2023 20:27
@@ -309,6 +316,12 @@ public static function provideDataProviderMethodCases(): iterable
*/
public function testThatTestClassCoversAreCorrect(string $testClassName): void
{
if (DocumentationTest::class === $testClassName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this class cannot have cover annotation tested ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1) PhpCsFixer\Tests\AutoReview\ProjectCodeTest::testThatTestClassCoversAreCorrect with data set #7 ('PhpCsFixer\Tests\AutoReview\D...onTest')
Class "\PhpCsFixer\AutoReview\Documentation" does not exist

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hint: this exception is not intuutive. When doing any exceptions for some of the tests , provide in-code comment with reason. Otherwise John doe will not be aware why it's needed (and fact that "if they remove hack tests will fail so they will not remove the hack" is not helping them to understand why we have it in first place)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought whoever could be interested can go to DocumentationTest and see the @covers there.

However, let's get rid of the exception and update @covers for DocumentationTest.

@@ -848,7 +861,7 @@ private static function getTestClasses(): array

$finder = Finder::create()
->files()
->name('*.php')
->name('*Test.php')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kubawerlos kubawerlos merged commit 4a94484 into PHP-CS-Fixer:master Dec 16, 2023
25 checks passed
@kubawerlos kubawerlos deleted the dx_fix_checking_for_extends branch December 16, 2023 09:07
danog pushed a commit to zoonru/PHP-CS-Fixer that referenced this pull request Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants