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

Tests: add missing .fixed files #299

Closed
jrfnl opened this issue Jan 23, 2024 · 1 comment · Fixed by #476
Closed

Tests: add missing .fixed files #299

jrfnl opened this issue Jan 23, 2024 · 1 comment · Fixed by #476

Comments

@jrfnl
Copy link
Member

jrfnl commented Jan 23, 2024

There are currently five test case files for which the associated sniff would make fixes, but which do not have a corresponding .fixed file version of the test case file to verify that the fixes made are correct.

Two of these are for JS/CSS tests. I'm not concerned about those as support for this will be dropped in 4.0 anyway.

However, for the other three, a .fixed file should be added and it should be carefully verified that the fixes made by the sniff are actually correct as this hasn't been safeguarded over time.

To verify the fixes, one will need to scrutinize what the sniff actually does + one would likely need to dig into the file history to see when those tests were added and in relation to what issue(s).

Note: a possible conclusion from this exercise could be that there is a bug in one or more of the sniffs and fixes are being made where they shouldn't be made. If that's the case, the sniff would need to be fixed instead.

1) PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace\ScopeIndentUnitTest::testSniff
Missing fixed version of ScopeIndentUnitTest.inc to verify the accuracy of fixes, while the sniff is making fixes against the test case file

2) PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces\UseDeclarationUnitTest::testSniff
Missing fixed version of UseDeclarationUnitTest.17.inc to verify the accuracy of fixes, while the sniff is making fixes against the test case file

3) PHP_CodeSniffer\Standards\Squiz\Tests\Commenting\ClosingDeclarationCommentUnitTest::testSniff
Missing fixed version of ClosingDeclarationCommentUnitTest.inc to verify the accuracy of fixes, while the sniff is making fixes against the test case file

For completeness, these are the other two missing ones. These do not need to be addressed.

4) PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures\SwitchDeclarationUnitTest::testSniff
Missing fixed version of SwitchDeclarationUnitTest.js to verify the accuracy of fixes, while the sniff is making fixes against the test case file

5) PHP_CodeSniffer\Standards\Squiz\Tests\CSS\LowercaseStyleDefinitionUnitTest::testSniff
Missing fixed version of LowercaseStyleDefinitionUnitTest.css to verify the accuracy of fixes, while the sniff is making fixes against the test case file
@DannyvdSluijs
Copy link
Contributor

Currently from the master branch (7aceb91)

There are only three warnings left, which include one for a .css file and one for a .js file. Which means there is only one warning left in order to resolve this issues. For this I've created #476

Remaining warnings:

There were 3 warnings:

1) PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace\ScopeIndentUnitTest::testSniff
Missing fixed version of ScopeIndentUnitTest.inc to verify the accuracy of fixes, while the sniff is making fixes against the test case file

/home/runner/work/PHP_CodeSniffer/PHP_CodeSniffer/tests/TestSuite7.php:28
phpvfscomposer:///home/runner/work/PHP_CodeSniffer/PHP_CodeSniffer/vendor/phpunit/phpunit/phpunit:97

2) PHP_CodeSniffer\Standards\Squiz\Tests\CSS\LowercaseStyleDefinitionUnitTest::testSniff
Missing fixed version of LowercaseStyleDefinitionUnitTest.css to verify the accuracy of fixes, while the sniff is making fixes against the test case file

/home/runner/work/PHP_CodeSniffer/PHP_CodeSniffer/tests/TestSuite7.php:28
phpvfscomposer:///home/runner/work/PHP_CodeSniffer/PHP_CodeSniffer/vendor/phpunit/phpunit/phpunit:97

3) PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures\SwitchDeclarationUnitTest::testSniff
Missing fixed version of SwitchDeclarationUnitTest.js to verify the accuracy of fixes, while the sniff is making fixes against the test case file

/home/runner/work/PHP_CodeSniffer/PHP_CodeSniffer/tests/TestSuite7.php:28
phpvfscomposer:///home/runner/work/PHP_CodeSniffer/PHP_CodeSniffer/vendor/phpunit/phpunit/phpunit:97

@jrfnl jrfnl closed this as completed in #476 May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants